Skip to content

Commit

Permalink
netlist: gate netlist filegroup use-case
Browse files Browse the repository at this point in the history
Signed-off-by: Øyvind Harboe <[email protected]>
  • Loading branch information
oharboe committed Dec 22, 2024
1 parent ec02759 commit dd686a1
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 14 deletions.
51 changes: 39 additions & 12 deletions BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -264,20 +264,14 @@ orfs_flow(
],
)

# Need full flow to test final gatelist extraction
orfs_flow(
name = "regfile_128x65",
abstract_stage = "cts",
arguments = SRAM_ARGUMENTS,
stage_arguments = {
"floorplan": BLOCK_FLOORPLAN | {
"DIE_AREA": "0 0 400 400",
"CORE_AREA": "2 2 298 298",
"IO_CONSTRAINTS": "$(location :io-sram)",
},
"place": {
"PLACE_DENSITY": "0.3",
"IO_CONSTRAINTS": "$(location :io-sram)",
},
arguments = SRAM_ARGUMENTS | BLOCK_FLOORPLAN | {
"DIE_AREA": "0 0 400 400",
"CORE_AREA": "2 2 298 298",
"IO_CONSTRAINTS": "$(location :io-sram)",
"PLACE_DENSITY": "0.20"
},
stage_sources = {
"synth": [":constraints-sram"],
Expand Down Expand Up @@ -362,3 +356,36 @@ py_binary(
main = "plot-retiming.py",
deps = [requirement("matplotlib")],
)

filegroup(
name = "gatelist",
srcs = [
"lb_32x128_final",
"regfile_128x65_final",
],
output_group = "6_final.v",
)

filegroup(
name = "spef",
srcs = [
"lb_32x128_final",
"regfile_128x65_final",
],
output_group = "6_final.spef",
)

# gate netlists can be build by e.g. Verilator, mock
# usage of the gate netlists here to demonstrate the
# usecase
genrule(
name = "gatelist_wc",
srcs = [
":gatelist",
":spef",
],
outs = [
"gatelist_wc.txt",
],
cmd = "wc -l $(locations :gatelist) $(locations :spef) > $@",
)
4 changes: 2 additions & 2 deletions test/rtl/regfile_128x65.sv
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ module regfile_128x65(
R5_data
);

// reduced from 128 to 3 to speed up tests
reg [64:0] Memory[0:3];
// reduced from 128 to 1 to speed up tests
reg [64:0] Memory[0:0];
always @(posedge W0_clk) begin
if (W0_en)
Memory[W0_addr[3:0] ^ W0_addr[7:4]] <= W0_data;
Expand Down

0 comments on commit dd686a1

Please sign in to comment.