Skip to content

Commit

Permalink
naja: test and mock naja target
Browse files Browse the repository at this point in the history
Co-authored-by: xtof <[email protected]>

Signed-off-by: Øyvind Harboe <[email protected]>
  • Loading branch information
oharboe committed Oct 20, 2024
1 parent 5021f5e commit 3c947ac
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 9 deletions.
9 changes: 9 additions & 0 deletions .github/scripts/smoketests.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash
set -ex
bazel build lb_32x128_shared_synth_floorplan wns_report //sram:sdq_17x64_mock-naja_floorplan_deps //sram:mock-naja
grep naja bazel-bin/sram/mock-naja.v
grep -q naja bazel-bin/sram/results/asap7/sdq_17x64/mock-naja/1_synth.v && false || true
(bazel build //sram:sdq_17x64_naja-error_floorplan 2>&1 || true) | grep "syntax error"
# FIXME not implemented yet
# bazel run //sram:sdq_17x64_naja_floorplan_deps $(pwd)/tmp
# grep naja tmp/sram/results/asap7/sdq_17x64/mock-naja/1_synth.v
9 changes: 1 addition & 8 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -131,14 +131,7 @@ jobs:
uses: actions/checkout@v4
- name: Smoketests
run: |
set -ex
bazel build lb_32x128_shared_synth_floorplan wns_report //sram:sdq_17x64_naja_floorplan_deps //sram:naja
grep naja bazel-bin/sram/naja.v
grep -q naja bazel-bin/sram/results/asap7/sdq_17x64/naja/1_synth.v && false || true
(bazel build //sram:sdq_17x64_naja-error_floorplan || true) | grep "syntax error"
# FIXME not implemented yet
# bazel run //sram:sdq_17x64_naja_floorplan_deps $(pwd)/tmp
# grep naja tmp/sram/results/asap7/sdq_17x64/naja/1_synth.v
.github/scripts/smoketests.sh
test-target-local-clean-setup:
name: Local flow - clean setup
Expand Down
20 changes: 19 additions & 1 deletion sram/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ FAST_SETTINGS = {
"naja": {
"floorplan": {"1_synth.v": ":naja"},
},
"mock-naja": {
"floorplan": {"1_synth.v": ":mock-naja"},
},
"naja-error": {
"floorplan": {"1_synth.v": ":naja-error"},
},
Expand All @@ -39,6 +42,7 @@ FAST_SETTINGS = {
verilog_files = [":fakeram/sdq_17x64.sv"],
) for variant in [
"base",
"mock-naja",
"naja",
"naja-error",
]]
Expand All @@ -59,14 +63,28 @@ filegroup(

# Read in the renamed synthesis output from above and provide
# the original name to the next stage
genrule(
name = "mock-naja",
srcs = [
":sdq_17x64_synth_unedited",
":sdq_17x64_synth_mergedlib",
],
outs = ["mock-naja.v"],
cmd = "mkdir -p `dirname $@`; ls $(location :sdq_17x64_synth_mergedlib); echo \"// imagine naja edits in this file\" > $@ && cat $(location :sdq_17x64_synth_unedited) >> $@",
)

# FIXME some better way to deploy naja in Bazel environment is needed
genrule(
name = "naja",
srcs = [
":sdq_17x64_synth_unedited",
":sdq_17x64_synth_mergedlib",
"naja_edit/install/bin/naja_edit",
"naja_edit/install/lib/python",
"naja_edit/install/share/naja/primitives/asap7_new.py",
],
outs = ["naja.v"],
cmd = "mkdir -p `dirname $@`; ls $(location :sdq_17x64_synth_mergedlib); echo \"// imagine naja edits in this file\" > $@ && cat $(location :sdq_17x64_synth_unedited) >> $@",
cmd = "mkdir -p `dirname $@`; export PYTHONPATH=$(location naja_edit/install/lib/python) && $(location naja_edit/install/bin/naja_edit) -a all -p $(location :sdq_17x64_synth_mergedlib) -f verilog -t verilog -i $(location :sdq_17x64_synth_unedited) -o $@",
)

genrule(
Expand Down

0 comments on commit 3c947ac

Please sign in to comment.