From 7566eae213a0da049b1c6e28efb4196818967b85 Mon Sep 17 00:00:00 2001 From: Harrison Liew Date: Fri, 24 Feb 2023 14:56:28 -0800 Subject: [PATCH] fix & clarify hierarchical flows --- docs/VLSI/Advanced-Usage.rst | 10 +++++++++- vlsi/power.mk | 17 ++++++++++++----- 2 files changed, 21 insertions(+), 6 deletions(-) diff --git a/docs/VLSI/Advanced-Usage.rst b/docs/VLSI/Advanced-Usage.rst index 07e71884..e5ef18ad 100644 --- a/docs/VLSI/Advanced-Usage.rst +++ b/docs/VLSI/Advanced-Usage.rst @@ -22,6 +22,14 @@ The Make-based build system provided supports using Hammer without using RTL gen ``CUSTOM_VLOG`` breaks the dependency on the rest of the Chipyard infrastructure and does not start any Chisel/FIRRTL elaboration. ``VLSI_TOP`` selects the top module from your custom Verilog files. +Hierarchical Flows +------------------ +The Make-based build system supports bottom-up hierarchical place-and-route flows. You will need to create your module hierarchy in your input configuration YMLs before running the ``buildfile`` make target. If you change your hierarchy at any point, the ``hammer.d`` file needs to be re-generated. + +Throughout the execution of the hierarchical flow, you must override the ``VLSI_TOP`` Make variable to the hierarchical submodule that you are currently working on. Otherwise, simulation and power flows will not work properly. + +For more information about setting up hierarchical flows, see the `Hammer documentation `__. + Under the Hood -------------- To uncover what is happening under the hood, here are the commands that are executed: @@ -95,6 +103,6 @@ With the Synopsys plugin, hierarchical RTL and gate-level simulation is supporte * ``redo-`` can be appended to all above targets to break dependency tracking, like described above. -* ``-$(VLSI_TOP)`` suffixes denote simulations/power analysis on a submodule in a hierarchical flow. Note that you must provide the testbenches for these modules since the default testbench only simulates a Chipyard-based ``ChipTop`` DUT instance. +* ``-$(VLSI_TOP)`` suffixes denote simulations/power analysis on a submodule in a hierarchical flow (remember to override this variable, as explained above). Note that you must provide the testbenches for these modules since the default testbench only simulates a Chipyard-based ``ChipTop`` DUT instance. The simulation configuration (e.g. binaries) can be edited for your design. See the ``Makefile`` and refer to Hammer's documentation for how to set up simulation parameters for your design. diff --git a/vlsi/power.mk b/vlsi/power.mk index d55b965f..5e265a35 100644 --- a/vlsi/power.mk +++ b/vlsi/power.mk @@ -2,8 +2,9 @@ POWER_CONF = $(OBJ_DIR)/power-inputs.yml POWER_RTL_CONF = $(OBJ_DIR)/power-rtl-inputs.yml POWER_SYN_CONF = $(OBJ_DIR)/power-syn-inputs.yml POWER_PAR_CONF = $(OBJ_DIR)/power-par-inputs.yml +POWER_PAR_HIER_CONF = $(OBJ_DIR)/power-par-$(VLSI_TOP)-inputs.yml -.PHONY: $(POWER_CONF) $(POWER_RTL_CONF) $(POWER_SYN_CONF) $(POWER_PAR_CONF) +.PHONY: $(POWER_CONF) $(POWER_RTL_CONF) $(POWER_SYN_CONF) $(POWER_PAR_CONF) $(POWER_PAR_HIER_CONF) $(POWER_CONF): $(VLSI_RTL) mkdir -p $(dir $@) @@ -45,6 +46,12 @@ $(POWER_PAR_CONF): $(VLSI_RTL) echo " level: par" >> $@ echo " database: '$(OBJ_DIR)/par-rundir/$(VLSI_TOP)_FINAL'" >> $@ +$(POWER_PAR_HIER_CONF): $(VLSI_RTL) + echo "vlsi.core.power_tool: hammer.power.voltus" > $@ + echo "power.inputs:" >> $@ + echo " level: par" >> $@ + echo " database: '$(OBJ_DIR)/par-$(VLSI_TOP)/$(VLSI_TOP)_FINAL'" >> $@ + power-rtl: $(POWER_CONF) $(POWER_RTL_CONF) sim-rtl-debug power-rtl-$(VLSI_TOP): $(POWER_CONF) $(POWER_RTL_CONF) sim-rtl-debug-$(VLSI_TOP) power-rtl: override HAMMER_POWER_EXTRA_ARGS += -p $(POWER_CONF) -p $(POWER_RTL_CONF) @@ -64,12 +71,12 @@ redo-power-syn: override HAMMER_EXTRA_ARGS += -p $(POWER_CONF) -p $(POWER_SYN_CO redo-power-syn-$(VLSI_TOP): override HAMMER_EXTRA_ARGS += -p $(POWER_CONF) -p $(POWER_SYN_CONF) power-par: $(POWER_CONF) $(POWER_PAR_CONF) sim-par-debug -power-par-$(VLSI_TOP): $(POWER_CONF) $(POWER_PAR_CONF) sim-par-debug-$(VLSI_TOP) +power-par-$(VLSI_TOP): $(POWER_CONF) $(POWER_PAR_HIER_CONF) sim-par-debug-$(VLSI_TOP) power-par: override HAMMER_POWER_EXTRA_ARGS += -p $(POWER_CONF) -p $(POWER_PAR_CONF) -power-par-$(VLSI_TOP): override HAMMER_POWER_EXTRA_ARGS += -p $(POWER_CONF) -p $(POWER_PAR_CONF) +power-par-$(VLSI_TOP): override HAMMER_POWER_EXTRA_ARGS += -p $(POWER_CONF) -p $(POWER_PAR_HIER_CONF) redo-power-par: $(POWER_CONF) $(POWER_PAR_CONF) -redo-power-par-$(VLSI_TOP): $(POWER_CONF) $(POWER_PAR_CONF) +redo-power-par-$(VLSI_TOP): $(POWER_CONF) $(POWER_PAR_HIER_CONF) redo-power-par: override HAMMER_EXTRA_ARGS += -p $(POWER_CONF) -p $(POWER_PAR_CONF) -redo-power-par-$(VLSI_TOP): override HAMMER_EXTRA_ARGS += -p $(POWER_CONF) -p $(POWER_PAR_CONF) +redo-power-par-$(VLSI_TOP): override HAMMER_EXTRA_ARGS += -p $(POWER_CONF) -p $(POWER_PAR_HIER_CONF) $(OBJ_DIR)/power-%/power-output-full.json: private override HAMMER_EXTRA_ARGS += $(HAMMER_POWER_EXTRA_ARGS)