Skip to content

Commit 76b033a

Browse files
committed
mock-array: read_power_activities MockArray.vcd test case
To do post synthesis simulation and use read_power_activities for report_power, run: make DESIGN_CONFIG=designs/asap7/mock-array/config.mk final simulate power This is a starting point for collaboration of separate concerns that will be addressed in multiple PRs that try to address a single concern at the time: - Where should the behavioral .v files for ASAP7 go? - The simulation needs to happen for every build. Today this happens using Chisel, but it would be better to use Verilator to provide an example that can be reused for other designs. Although users may generate Verilog using tools such as XLS, Aramanth, Chisel, etc., ORFS takes Verilog as read and is not involved in this process. - Add post synthesis report_power after read_power_activities for asap7/gcd - What to do about read_spef for Element, currently commented out? - Regression testing should include read_power_activities report_power for the designs that support it. - The power.tcl is currently hard-coded to mock-array, make it general so that it works for all designs, including those that use BLOCKS - The "power" and "simulate" targets are specific to mock-array, make them generic and have some default behavior when for designs it is not used. - The behavioral model of ASAP7 is not supported by Verilator. ChatGPT seems to be able to whip up a behavioral model easily, but where should these files go? I don't think it makes sense to try to update ASAP7, I think these files are specific to ORFS. Signed-off-by: Øyvind Harboe <[email protected]>
1 parent 019c611 commit 76b033a

File tree

12 files changed

+11554
-46
lines changed

12 files changed

+11554
-46
lines changed

flow/designs/asap7/mock-array/config.mk

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,16 @@ verilog:
4040
export MOCK_ARRAY_COLS=$(word 2, $(MOCK_ARRAY_TABLE)) ; \
4141
./designs/asap7/mock-array/verilog.sh
4242

43+
.PHONY: simulate
44+
simulate:
45+
export MOCK_ARRAY_ROWS=$(word 1, $(MOCK_ARRAY_TABLE)) ; \
46+
export MOCK_ARRAY_COLS=$(word 2, $(MOCK_ARRAY_TABLE)) ; \
47+
./designs/asap7/mock-array/simulate.sh
48+
49+
.PHONY: power
50+
power:
51+
$(OPENSTA_EXE) -no_init -exit designs/asap7/mock-array/power.tcl
52+
4353
# If this design isn't quickly done in detailed routing, something is wrong.
4454
# At time of adding this option, only 12 iterations were needed for 0
4555
# violations.
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
foreach libFile $::env(LIB_FILES) {
2+
read_liberty $libFile
3+
}
4+
5+
read_verilog results/asap7/mock-array_Element/base/6_final.v
6+
read_verilog $::env(RESULTS_DIR)/6_final.v
7+
read_verilog designs/src/mock-array/post/empty.v
8+
9+
link_design MockArray
10+
11+
read_sdc $::env(RESULTS_DIR)/6_final.sdc
12+
read_spef $::env(RESULTS_DIR)/6_final.spef
13+
# FIXME lots of warnings
14+
#read_spef results/asap7/mock-array_Element/base/6_final.spef
15+
16+
report_power
17+
read_power_activities -scope TOP/MockArrayTestbench/postSynthesis -vcd designs/src/mock-array/MockArrayTestbench.vcd
18+
report_power
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#!/usr/bin/env bash
2+
set -ex
3+
4+
# allow this script to be invoked from any folder
5+
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
6+
BASE=$DIR/../..
7+
8+
cd $DIR
9+
10+
cd ../../src/mock-array
11+
cp ../../../results/asap7/mock-array/base/6_final.v post/MockArrayFinal.v
12+
cp ../../../results/asap7/mock-array_Element/base/6_final.v post/MockArrayElementFinal.v
13+
14+
pwd
15+
sbt -Duser.home="$HOME" -Djline.terminal=jline.UnsupportedTerminal -batch \
16+
"test:runMain SimulatePostSynthesis --width ${MOCK_ARRAY_COLS} --height ${MOCK_ARRAY_ROWS} --dataWidth ${MOCK_ARRAY_DATAWIDTH}"
17+
18+
cp test_run_dir/MockArray_should_Wiggle_some_wires/MockArrayTestbench.vcd .
19+

flow/designs/asap7/mock-array/verilog.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,8 @@ sbt -Duser.home="$HOME" -Djline.terminal=jline.UnsupportedTerminal -batch \
1414

1515
# reduce git noise as these comments will change if the line numbers in Chisel changes
1616
find . -name "*.v" -type f -exec sed -i 's/ \/\/.*$//' {} \;
17+
18+
sbt -Duser.home="$HOME" -Djline.terminal=jline.UnsupportedTerminal -batch \
19+
"test:runMain GenerateMockArray --width ${MOCK_ARRAY_COLS} --height ${MOCK_ARRAY_ROWS} --dataWidth ${MOCK_ARRAY_DATAWIDTH} -- --emit-modules verilog --emission-options disableMemRandomization,disableRegisterRandomization --target-dir ."
20+
21+
cp test_run_dir/MockArray_should_Wiggle_some_wires/MockArray.vcd .
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
MockArray*.v

0 commit comments

Comments
 (0)