Skip to content

Commit 00c74b1

Browse files
committed
test/orfs/mock-array: test reporting power per module with -hier
Signed-off-by: Øyvind Harboe <[email protected]>
1 parent 4534556 commit 00c74b1

File tree

2 files changed

+79
-0
lines changed

2 files changed

+79
-0
lines changed

test/orfs/mock-array/mock-array.bzl

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,10 @@ POWER_TESTS = [
223223
"power_instances",
224224
]
225225

226+
ELEMENT_POWER_TESTS = [
227+
"power_modules",
228+
]
229+
226230
def mock_array(name, config):
227231
"""Defines the mock array build targets for OpenROAD-flow-scripts.
228232
@@ -509,3 +513,60 @@ def mock_array(name, config):
509513
),
510514
],
511515
)
516+
517+
for power_test in ELEMENT_POWER_TESTS:
518+
for stage in POWER_STAGES:
519+
orfs_run(
520+
name = "Element_{variant}_{stage}_{power_test}".format(
521+
variant = variant,
522+
power_test = power_test,
523+
stage = stage,
524+
),
525+
src = ":Element_{variant}_{stage}".format(variant = variant, stage = stage),
526+
outs = [
527+
"{variant}_{power_test}_{stage}.txt".format(
528+
variant = variant,
529+
power_test = power_test,
530+
stage = stage,
531+
),
532+
],
533+
arguments = {
534+
"OUTPUT": "$(location :{variant}_{power_test}_{stage}.txt)".format(
535+
variant = variant,
536+
power_test = power_test,
537+
stage = stage,
538+
),
539+
"POWER_STAGE_NAME": stage,
540+
"POWER_STAGE_STEM": POWER_STAGE_STEM[stage],
541+
"VCD_STIMULI": "$(location :vcd_{variant}_{stage})".format(variant = variant, stage = stage),
542+
},
543+
data = [
544+
":vcd_{variant}_{stage}".format(variant = variant, stage = stage),
545+
],
546+
script = ":{power_test}.tcl".format(power_test = power_test),
547+
tags = ["manual"],
548+
visibility = ["//visibility:public"],
549+
)
550+
551+
sh_test(
552+
name = "Element_{variant}_{power_test}_{stage}_test".format(
553+
variant = variant,
554+
power_test = power_test,
555+
stage = stage,
556+
),
557+
srcs = ["ok.sh"],
558+
args = [
559+
"$(location :Element_{variant}_{stage}_{power_test})".format(
560+
variant = variant,
561+
stage = stage,
562+
power_test = power_test,
563+
),
564+
],
565+
data = [
566+
":Element_{variant}_{stage}_{power_test}".format(
567+
variant = variant,
568+
power_test = power_test,
569+
stage = stage,
570+
),
571+
],
572+
)
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
source $::env(SCRIPTS_DIR)/load.tcl
2+
load_design $::env(POWER_STAGE_STEM).odb $::env(POWER_STAGE_STEM).sdc
3+
4+
log_cmd report_power
5+
6+
# FIXME add check that all pins are annotated and that parasitics are
7+
# estimated or read from SPEF
8+
9+
set instances {io_outs_down_mult io_outs_left_mult io_outs_up_mult io_outs_right_mult}
10+
report_power -instances $instances
11+
12+
# FIXME
13+
# log_cmd report_parasitic_annotation
14+
#log_cmd report_activity_annotation -report_unannotated
15+
16+
set f [open $::env(OUTPUT) w]
17+
puts $f OK
18+
close $f

0 commit comments

Comments
 (0)