Skip to content

Commit

Permalink
megaboom: branch predictors as macros
Browse files Browse the repository at this point in the history
Signed-off-by: Øyvind Harboe <[email protected]>
  • Loading branch information
oharboe committed Nov 20, 2024
1 parent 130f493 commit 77e30b8
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 2 deletions.
39 changes: 38 additions & 1 deletion BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -377,6 +377,13 @@ SWEEP = {
},
"stage_sources": {"floorplan": ["write_macro_placement"]},
},
"1": {
"description": "Hierarchical, branch predictors as macros",
"variables": {
"HOLD_SLACK_MARGIN": "-900",
},
"macros": ["ComposedBranchPredictorBank_generate_abstract"],
},
}

BOOMTILE_VARIABLES = SKIP_REPORT_METRICS | FAST_BUILD_SETTINGS | {
Expand Down Expand Up @@ -428,14 +435,44 @@ boomtile_all_rams = boom_regfile_rams.keys() + all_srams.keys()

ALL_VARIANTS = SWEEP | OTHER_VARIANTS

BRANCH_PREDICTOR_VARIABLES = SKIP_REPORT_METRICS | FAST_BUILD_SETTINGS | BLOCK_FLOORPLAN | {
"IO_CONSTRAINTS": "$(location :io-boomtile)",
"PLACE_DENSITY": "0.24",
# We only need hierarchical synthesis when we are running through floorplan
# write_macro_placement macros.tcl
"SYNTH_HIERARCHICAL": "1",
"SDC_FILE": "$(location :constraints-boomtile)",
"MACRO_PLACE_HALO": "19 19",
"PLACE_PINS_ARGS": "-annealing",
"DIE_AREA": "0 0 500 500",
"CORE_AREA": "0 0 498 498",
# Saves hours of build time, specific to BoomTile
"SKIP_LAST_GASP": "1",
"SETUP_SLACK_MARGIN": "-1300",
"HOLD_SLACK_MARGIN": "-200",
}

orfs_flow(
name = "ComposedBranchPredictorBank",
abstract_stage = "floorplan",
arguments = BRANCH_PREDICTOR_VARIABLES,
macros = [
":" + m + "_generate_abstract"
for m in boomtile_all_rams
],
mock_area = 0.5,
stage_sources = BOOMTILE_SOURCES,
verilog_files = all_source_files,
)

[orfs_flow(
name = "BoomTile",
arguments = BOOMTILE_VARIABLES | ALL_VARIANTS[variant].get("variables", {}),
macros = [
":" + m + "_generate_abstract"
for m in boomtile_all_rams
if m not in ALL_VARIANTS[variant].get("dissolve", [])
],
] + ALL_VARIANTS[variant].get("macros", []),
previous_stage = ALL_VARIANTS[variant].get("previous_stage", {}),
renamed_inputs = ALL_VARIANTS[variant].get("renamed_inputs", {}),
# Explictily set arguments for a stage when stages are not listed in
Expand Down
18 changes: 17 additions & 1 deletion constraints-boomtile.sdc
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,20 @@ set clk_port_name clock
# Ignore synchronous reset for now.
set_false_path -from [get_ports reset]

source $env(PLATFORM_DIR)/constraints.sdc
set clk_port [get_ports $clk_port_name]
create_clock -period $clk_period -waveform [list 0 [expr $clk_period / 2]] -name $clk_name $clk_port

set non_clk_inputs [lsearch -inline -all -not -exact [all_inputs] $clk_port]

if {[llength [all_registers]] > 0} {
set all_register_outputs [get_pins -of_objects [all_registers] -filter {direction == output}]
set_max_delay [expr {[info exists in2reg_max] ? $in2reg_max : 80}] -from $non_clk_inputs -to [all_registers]
set_max_delay [expr {[info exists reg2out_max] ? $reg2out_max : 80}] -from $all_register_outputs -to [all_outputs]

group_path -name in2reg -from $non_clk_inputs -to [all_registers]
group_path -name reg2out -from [all_registers] -to [all_outputs]
group_path -name reg2reg -from [all_registers] -to [all_registers]
}

set_max_delay [expr {[info exists in2out_max] ? $in2out_max : 80}] -from $non_clk_inputs -to [all_outputs]
group_path -name in2out -from $non_clk_inputs -to [all_outputs]

0 comments on commit 77e30b8

Please sign in to comment.