Skip to content

Commit

Permalink
debug simulations (#478)
Browse files Browse the repository at this point in the history
* min decoder gate size is 0.8

* comment out lvs

* increase addr gate inv size

* remove comment

* pex sim

---------

Co-authored-by: Rahul Kumar <rahulkumar@eecs.berkeley.edu>
  • Loading branch information
rahulk29 and Rahul Kumar authored Oct 11, 2024
1 parent bc004f5 commit 5fcd2c8
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 32 deletions.
6 changes: 1 addition & 5 deletions src/blocks/decoder/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -234,11 +234,7 @@ fn size_path(path: &[&PlanTreeNode], end: &f64) -> TreeNode {
.rev()
.map(|v| {
let v = lp.value(*v);
if v < 0.5 {
0.5
} else {
v
}
f64::max(v, 0.8)
})
.collect::<Vec<_>>();
values.push(1.);
Expand Down
54 changes: 27 additions & 27 deletions src/blocks/sram/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -230,10 +230,9 @@ impl Script for SramPhysicalDesignScript {
routing_style: RoutingStyle::Driver,
max_width: None,
invs: vec![],
// TODO fix, should be minimum sized AND2 unless sized elsewhere
gate: GateParams::And2(AndParams {
nand: NAND2_PARAMS,
inv: INV_PARAMS,
inv: INV_PARAMS.scale(4.),
}),
num: 2 * params.row_bits(),
child_sizes: vec![],
Expand Down Expand Up @@ -598,6 +597,7 @@ pub(crate) mod tests {
use crate::paths::*;
use crate::setup_ctx;
use crate::tests::test_work_dir;
use substrate::schematic::netlist::NetlistPurpose;

use super::*;

Expand Down Expand Up @@ -675,29 +675,29 @@ pub(crate) mod tests {
// substrate::verification::lvs::LvsSummary::Pass
// ));

// let pex_path = out_spice(&work_dir, "pex_schematic");
// let pex_dir = work_dir.join("pex");
// let pex_level = calibre::pex::PexLevel::Rc;
// let pex_netlist_path = crate::paths::out_pex(&work_dir, "pex_netlist", pex_level);
// ctx.write_schematic_to_file_for_purpose::<Sram>(
// &$params,
// &pex_path,
// NetlistPurpose::Pex,
// ).expect("failed to write pex source netlist");
// let mut opts = std::collections::HashMap::with_capacity(1);
// opts.insert("level".into(), pex_level.as_str().into());

// ctx.run_pex(substrate::verification::pex::PexInput {
// work_dir: pex_dir,
// layout_path: gds_path.clone(),
// layout_cell_name: $params.name().clone(),
// layout_format: substrate::layout::LayoutFormat::Gds,
// source_paths: vec![pex_path],
// source_cell_name: $params.name().clone(),
// pex_netlist_path: pex_netlist_path.clone(),
// ground_net: "vss".to_string(),
// opts,
// }).expect("failed to run pex");
let pex_path = out_spice(&work_dir, "pex_schematic");
let pex_dir = work_dir.join("pex");
let pex_level = calibre::pex::PexLevel::Rc;
let pex_netlist_path = crate::paths::out_pex(&work_dir, "pex_netlist", pex_level);
ctx.write_schematic_to_file_for_purpose::<Sram>(
&$params,
&pex_path,
NetlistPurpose::Pex,
).expect("failed to write pex source netlist");
let mut opts = std::collections::HashMap::with_capacity(1);
opts.insert("level".into(), pex_level.as_str().into());

ctx.run_pex(substrate::verification::pex::PexInput {
work_dir: pex_dir,
layout_path: gds_path.clone(),
layout_cell_name: $params.name().clone(),
layout_format: substrate::layout::LayoutFormat::Gds,
source_paths: vec![pex_path],
source_cell_name: $params.name().clone(),
pex_netlist_path: pex_netlist_path.clone(),
ground_net: "vss".to_string(),
opts,
}).expect("failed to run pex");

let seq = TestSequence::Short;
let corners = ctx.corner_db();
Expand All @@ -706,11 +706,11 @@ pub(crate) mod tests {
for corner in corners.corners().take(1) {
let corner = corner.clone();
let params = $params.clone();
// let pex_netlist = Some(pex_netlist_path.clone());
let pex_netlist = Some(pex_netlist_path.clone());
let work_dir = work_dir.clone();
handles.push(std::thread::spawn(move || {
let ctx = setup_ctx();
let tb = crate::blocks::sram::testbench::tb_params(params, vdd, seq, None);
let tb = crate::blocks::sram::testbench::tb_params(params, vdd, seq, pex_netlist);
let work_dir = work_dir.join(format!(
"{}_{:.2}_{}",
corner.name(),
Expand Down

0 comments on commit 5fcd2c8

Please sign in to comment.