Skip to content

Commit 598cfc9

Browse files
committed
ram: minor changes to tcl scripts, changed name schemes
Signed-off-by: braydenl9988 <[email protected]>
1 parent b8df76a commit 598cfc9

File tree

2 files changed

+16
-15
lines changed

2 files changed

+16
-15
lines changed

src/ram/src/ram.cpp

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -405,14 +405,14 @@ void RamGen::generate(const int bytes_per_word,
405405
vector<dbBTerm*> write_enable(bytes_per_word, nullptr);
406406
for (int byte = 0; byte < bytes_per_word; ++byte) {
407407
auto in_name = fmt::format("we[{}]", byte);
408-
write_enable[byte] = makeBTerm(in_name);
408+
write_enable[byte] = makeBTerm(in_name, dbIoType::INPUT);
409409
}
410410

411411
// input bterms
412412
int num_inputs = std::ceil(std::log2(word_count));
413413
vector<dbBTerm*> addr(num_inputs, nullptr);
414414
for (int i = 0; i < num_inputs; ++i) {
415-
addr[i] = makeBTerm(fmt::format("addr[{}]", i));
415+
addr[i] = makeBTerm(fmt::format("addr[{}]", i), dbIoType::INPUT);
416416
}
417417

418418
// vector of nets storing inverter nets
@@ -440,31 +440,32 @@ void RamGen::generate(const int bytes_per_word,
440440

441441
vector<dbNet*> decoder_output_nets;
442442

443+
443444
for (int col = 0; col < bytes_per_word; ++col) {
444-
array<dbBTerm*, 8> D; // array for b-term for external inputs
445+
array<dbBTerm*, 8> D_bTerms; // array for b-term for external inputs
445446
array<dbNet*, 8> D_nets; // net for buffers
446447
for (int bit = 0; bit < 8; ++bit) {
447-
D[bit] = makeBTerm(fmt::format("D[{}]", bit + col * 8), dbIoType::INPUT);
448+
D_bTerms[bit] = makeBTerm(fmt::format("D[{}]", bit + col * 8), dbIoType::INPUT);
448449
D_nets[bit] = makeNet(fmt::format("D_nets[{}]", bit + col * 8), "net");
449450
}
450451

451452
vector<array<dbBTerm*, 8>> Q;
452453
// if readports == 1, only have Q outputs
453454
if (read_ports == 1) {
454-
array<dbBTerm*, 8> q;
455+
array<dbBTerm*, 8> q_bTerms;
455456
for (int bit = 0; bit < 8; ++bit) {
456457
auto out_name = fmt::format("Q[{}]", bit + col * 8);
457-
q[bit] = makeBTerm(out_name, dbIoType::OUTPUT);
458+
q_bTerms[bit] = makeBTerm(out_name, dbIoType::OUTPUT);
458459
}
459-
Q.push_back(q);
460+
Q.push_back(q_bTerms);
460461
} else {
461462
for (int read_port = 0; read_port < read_ports; ++read_port) {
462-
array<dbBTerm*, 8> q;
463+
array<dbBTerm*, 8> q_bTerms;
463464
for (int bit = 0; bit < 8; ++bit) {
464465
auto out_name = fmt::format("Q{}[{}]", read_port, bit + col * 8);
465-
q[bit] = makeBTerm(out_name, dbIoType::OUTPUT);
466+
q_bTerms[bit] = makeBTerm(out_name, dbIoType::OUTPUT);
466467
}
467-
Q.push_back(q);
468+
Q.push_back(q_bTerms);
468469
}
469470
}
470471

@@ -503,7 +504,7 @@ void RamGen::generate(const int bytes_per_word,
503504
"buffer",
504505
fmt::format("in[{}]", bit),
505506
buffer_cell_,
506-
{{"A", D[bit]->getNet()}, {"X", D_nets[bit]}});
507+
{{"A", D_bTerms[bit]->getNet()}, {"X", D_nets[bit]}});
507508
ram_grid.addCell(std::move(buffer_cell), bit);
508509
}
509510
}
@@ -563,11 +564,11 @@ void RamGen::generate(const int bytes_per_word,
563564
sites_width);
564565
}
565566

567+
ram_grid.placeGrid();
568+
566569
int max_y_coord = ram_grid.getHeight() * (word_count + 1);
567570
int max_x_coord = ram_grid.getRowWidth();
568571

569-
ram_grid.placeGrid();
570-
571572
block_->setDieArea(odb::Rect(0, 0, max_x_coord, max_y_coord));
572573
}
573574

src/ram/test/make_8x8.tcl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ generate_ram_netlist \
1515

1616
ord::design_created
1717

18-
filler_placement {sky130_fd_sc_hd__fill_1 sky130_fd_sc_hd__fill_2 sky130_fd_sc_hd__fill_4}
18+
filler_placement {sky130_fd_sc_hd__fill_1 sky130_fd_sc_hd__fill_2 sky130_fd_sc_hd__fill_4 sky130_fd_sc_hd__fill_8}
1919

2020
set def_file [make_result_file make_8x8.def]
2121
write_def $def_file
22-
22+
diff_files make_8x8.defok $def_file

0 commit comments

Comments
 (0)