Skip to content

Commit e41eab2

Browse files
committed
ram: fixed clang-tidy and tclint comments
Signed-off-by: braydenl9988 <[email protected]>
1 parent c9216f2 commit e41eab2

File tree

3 files changed

+11
-15
lines changed

3 files changed

+11
-15
lines changed

src/ram/include/ram/ram.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ class RamGen
3434
{
3535
public:
3636
RamGen(sta::dbNetwork* network, odb::dbDatabase* db, Logger* logger);
37-
~RamGen();
37+
~RamGen() = default;
3838

3939
void generate(int bytes_per_word,
4040
int word_count,

src/ram/src/ram.cpp

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@
1212

1313
namespace ram {
1414

15-
using odb::dbBlock;
16-
using odb::dbBPin;
1715
using odb::dbBTerm;
1816
using odb::dbInst;
1917
using odb::dbIoType;
@@ -33,8 +31,6 @@ RamGen::RamGen(sta::dbNetwork* network, odb::dbDatabase* db, Logger* logger)
3331
{
3432
}
3533

36-
RamGen::~RamGen() = default;
37-
3834
dbInst* RamGen::makeCellInst(
3935
Cell* cell,
4036
const std::string& prefix,
@@ -125,6 +121,7 @@ void RamGen::makeCellByte(Grid& ram_grid,
125121
for (int bit = first_byte; bit < first_byte + 8; ++bit) {
126122
auto name = fmt::format("{}.bit{}", prefix, bit);
127123
vector<dbNet*> outs;
124+
outs.reserve(read_ports);
128125
for (int read_port = 0; read_port < read_ports; ++read_port) {
129126
outs.push_back(data_output[read_port][bit]->getNet());
130127
}
@@ -352,9 +349,7 @@ void RamGen::findMasters()
352349
// for input buffers
353350
if (!buffer_cell_) {
354351
buffer_cell_ = findMaster(
355-
[](sta::LibertyPort* port) {
356-
return port->libertyCell()->isBuffer();
357-
},
352+
[](sta::LibertyPort* port) { return port->libertyCell()->isBuffer(); },
358353
"buffer");
359354
}
360355
}
@@ -383,7 +378,7 @@ void RamGen::generate(const int bytes_per_word,
383378
auto chip = db_->getChip();
384379
if (!chip) {
385380
chip = odb::dbChip::create(
386-
db_, db_->getTech(), ram_name.c_str(), odb::dbChip::ChipType::DIE);
381+
db_, db_->getTech(), ram_name, odb::dbChip::ChipType::DIE);
387382
}
388383

389384
block_ = chip->getBlock();
@@ -545,14 +540,14 @@ void RamGen::generate(const int bytes_per_word,
545540

546541
int num_sites = ram_grid.getRowWidth() / db_sites->getWidth();
547542
for (int i = 0; i <= word_count; ++i) { // extra for the layer of buffers
548-
auto row_name = fmt::format("RAM_ROW{}", i).c_str();
543+
auto row_name = fmt::format("RAM_ROW{}", i);
549544
auto y_coord = i * ram_grid.getHeight();
550545
auto row_orient = odb::dbOrientType::R0;
551546
if (i % 2 == 1) {
552547
row_orient = odb::dbOrientType::MX;
553548
}
554549
dbRow::create(block_,
555-
row_name,
550+
row_name.c_str(),
556551
db_sites,
557552
ram_origin.getX(),
558553
y_coord,

src/ram/test/make_8x8.tcl

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ generate_ram_netlist \
99
-bytes_per_word 1 \
1010
-word_count 8 \
1111
-read_ports 2 \
12-
-storage_cell sky130_fd_sc_hd__dlxtp_1
13-
# -tristate_cell sky130_fd_sc_hd__ebufn_2
12+
-storage_cell sky130_fd_sc_hd__dlxtp_1
13+
# -tristate_cell sky130_fd_sc_hd__ebufn_2
1414
# -inv_cell sky130_fd_sc_hd__inv_1
1515

1616
ord::design_created
@@ -19,8 +19,9 @@ ord::design_created
1919
# set_io_pin_constraint -direction output -region top:*
2020
# set_io_pin_constraint -pin_names {D[0] D[1]} -region top:*
2121
# place_pins -hor_layers met3 -ver_layers met2
22-
#
23-
# 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}
22+
#
23+
# filler_placement {sky130_fd_sc_hd__fill_1 sky130_fd_sc_hd__fill_2 \
24+
# sky130_fd_sc_hd__fill_4 sky130_fd_sc_hd__fill_8}
2425

2526
set def_file [make_result_file make_8x8.def]
2627
write_def $def_file

0 commit comments

Comments
 (0)