Comments (15)
Just to make sure I understood correctly, we need separate file names for top/model because when running gate-level simulation the simulator does not know if it is using the time-annotated synthesized modules or just the verilog files?
from chipyard.
Not quite. Let me try to be clearer. Suppose we had this module hierarchy:
Top Model
/ \ / \
ModA ModB Mod C
There are instances of ModA
and ModB
in Top
, and there are instances of ModB
and ModC
in Model.
In <long_name>.top.f
:
Top.sv
ModA.sv
ModB.sv
In <long_name>.model.f
:
Model.sv
ModB.sv
ModC.sv
So here's the problem sequence:
- The files in
<long_name>.top.f
are given to synthesis. We get a single mapped gate-level netlist, sayTop.mapped.v
. - We then combine
Top.mapped.v
and the files in<long_name>.model.f
for gate-level simulation. - Problem:
ModB
inTop.mapped.v
collides withModB
in<long_name>.model.f
. - Current hack in linked commit: remove
ModB.sv
from<long_name>.model.f
.
Why this is not OK: the instance of ModB
in Model
now refers to the synthesized version of ModB
. If the simulation is timing-annotated, the signals crossing the Top/Model boundary will have modified timing compared to the non-timing annotated simulation. Furthermore, if there are more shared modules, internally, the design under Model
may have timing violations. In general, the testbench (Model
) should not have any gate-level modules.
Desired solution:
In <long_name>.top.f
:
Top.sv
ModA.sv
ModB_Top.sv
In <long_name>.model.f
:
Model.sv
ModB_Model.sv
ModC.sv
Where the module name of is unique between the uniquified files and the instance declarations are properly changed.
TL;DR we need to restore the uniquification behavior of the old barstools Top/Harness separation pass.
from chipyard.
By instance declarations, do you mean that the module names inside the files should also be changes?
For instance, module Adder
to module Adder_Top
and module Adder_Model
? In my understanding, the tools reads the <long_name>.<top or model>.f
and works on those files so it seems like we don't need to change the module names inside the files.
from chipyard.
You do need to change the module names. This way, Adder_Top
can be synthesized and simulated inside the Top, while Adder_Model
remains behavioral and is simulated inside the Model.
I cannot use the tools (e.g. synthesis) to do this uniquification in Top's hierarchy - it cannot know what modules are also referenced in the Model. I would have to uniquify all of the modules under Top instead, which will break things (such as blackboxes)
from chipyard.
Hmmm I see. I'll look into this
from chipyard.
Bumping this - it needs to be fixed ASAP. We're running into gate-level synthesis unresolved modules when synthesis modifies a module (e.g. optimizes away a bit, creating a modified module name) or there are unsynthesizable modules (e.g. plusarg_reader used in TLMonitors). Thus, those modules that are also used by the TestHarness are no longer in the mapped Verilog file.
I think this is not quite correct:
chipyard/scripts/split-module-files.py
Line 74 in 10c2625
Related to https://groups.google.com/g/chipyard/c/tXCmoNNpwwg.
from chipyard.
Sorry for the delay, will work on this today
from chipyard.
Closing this issue for now
from chipyard.
I'm still seeing multiple module declarations errors in post-syn simulation.
I might be wrong, but based on my observation it's because instances under DUT are not uniquified.
Taking AsyncQueueSink*
for example, here are the error messages:
Error-[MPD] Module previously declared
The module was previously declared at:
"/bwrcq/C/allpan/chipyard/vlsi/build/chipyard.TestHarness.HPURocketConfig-ChipTop/syn-rundir/ChipTop.mapped.v",
459025
It is redeclared later at:
"/bwrcq/C/allpan/chipyard/vlsi/generated-src/chipyard.TestHarness.HPURocketConfig/gen-collateral/AsyncQueueSink_1.sv",
71: token is 'AsyncQueueSink_1'
module AsyncQueueSink_1(
^
Please remove one of the declarations and compile again.
Error-[MPD] Module previously declared
The module was previously declared at:
"/bwrcq/C/allpan/chipyard/vlsi/build/chipyard.TestHarness.HPURocketConfig-ChipTop/syn-rundir/ChipTop.mapped.v",
458272
It is redeclared later at:
"/bwrcq/C/allpan/chipyard/vlsi/generated-src/chipyard.TestHarness.HPURocketConfig/gen-collateral/AsyncQueueSink_2.sv",
71: token is 'AsyncQueueSink_2'
module AsyncQueueSink_2(
^
Please remove one of the declarations and compile again.
Error-[MPD] Module previously declared
The module was previously declared at:
"/bwrcq/C/allpan/chipyard/vlsi/build/chipyard.TestHarness.HPURocketConfig-ChipTop/syn-rundir/ChipTop.mapped.v",
460013
It is redeclared later at:
"/bwrcq/C/allpan/chipyard/vlsi/generated-src/chipyard.TestHarness.HPURocketConfig/gen-collateral/AsyncQueueSink.sv",
71: token is 'AsyncQueueSink'
module AsyncQueueSink(
^
Please remove one of the declarations and compile again.
In sim-inputs.yml
, I'm seeing these lines:
sim.inputs:
top_module: ChipTop
tb_name: ''
input_files:
- "/bwrcq/C/allpan/chipyard/vlsi/generated-src/chipyard.TestHarness.HPURocketConfig/gen-collateral/AsyncQueueSink_1.sv"
- "/bwrcq/C/allpan/chipyard/vlsi/generated-src/chipyard.TestHarness.HPURocketConfig/gen-collateral/AsyncQueueSink_2.sv"
- "/bwrcq/C/allpan/chipyard/vlsi/generated-src/chipyard.TestHarness.HPURocketConfig/gen-collateral/AsyncQueueSink_3.sv"
- "/bwrcq/C/allpan/chipyard/vlsi/generated-src/chipyard.TestHarness.HPURocketConfig/gen-collateral/AsyncQueueSink_3_TestHarness_UNIQUIFIED.sv"
- "/bwrcq/C/allpan/chipyard/vlsi/generated-src/chipyard.TestHarness.HPURocketConfig/gen-collateral/AsyncQueueSink.sv"
Only AsyncQueueSink_3
is uniquified.
I checked, AsyncQueueSink
is under ChipTop
but AsyncQueueSink_3
is not.
from chipyard.
@allpan3 Can you share your RTL & config so that I can run tests on it? I don't see those issues in the existing configs in CY (as CI seems to be passing) so it would be great if I could actually test the script on your design.
from chipyard.
@joey0320 This may be a little complicated since I'm using tstech28 and currently the RTL repo is private (and I'm not the owner).
I will ask my advisor if he can make the repo public or invite you, but even if not you can just copy from my area.
And also do you have access to tstech28? I think you have to have permission to the PDK on BWRC machine in order to run through the hammer flow successfully.
from chipyard.
I think I don't need the PDK. I just want to generate the verilog with your design so that I can see what is happening.
from chipyard.
Ok, you can try it. I think if you are just running the steps before sram_generator
then you probably won't need PDK.
Btw my project is written in verilog.
You can copy generator/hpu
from /bwrcq/C/allpan/chipyard/generators/hpu
.
You will also need to copy the modified build.sbt and RoCCAcceleratorConfigs.scala.
The config is HPURocketConfig
.
from chipyard.
And another issue is make sim-rtl
now has duplicated declarations.
Both inputs.yml
and sim-inputs.yml
are fed to hammer, and in sim-inputs.yml
, sim.inputs.input_files_meta
is append
, so all the files are specified twice in VCS.
./example-vlsi -e /bwrcq/C/allpan/new-chipyard/vlsi/env-bwrc.yml -p /bwrcq/C/allpan/new-chipyard/vlsi/example-tools.yml -p /bwrcq/C/allpan/new-chipyard/vlsi/tstech28.yml -p /bwrcq/C/allpan/new-chipyard/vlsi/build/chipyard.TestHarness.RocketConfig-ChipTop/inputs.yml -p /bwrcq/C/allpan/new-chipyard/vlsi/build/chipyard.TestHarness.RocketConfig-ChipTop/sram_generator-output.json -p /bwrcq/C/allpan/new-chipyard/vlsi/tstech28_sram_macros/sram_generator-output.yml -p /bwrcq/C/allpan/new-chipyard/vlsi/build/chipyard.TestHarness.RocketConfig-ChipTop/sim-inputs.yml --sim_rundir /bwrcq/C/allpan/new-chipyard/vlsi/build/chipyard.TestHarness.RocketConfig-ChipTop/sim-rtl-rundir --obj_dir /bwrcq/C/allpan/new-chipyard/vlsi/build/chipyard.TestHarness.RocketConfig-ChipTop sim
I ran with RocketConfig this time so it should be a common issue.
from chipyard.
I suspect using DFS is not correct with this check:
chipyard/scripts/uniqify-module-names.py
Line 63 in 15e22d9
If the instance hierarchy is as follows, where ModA is the model, and ModB and ModC need to be uniquified:
ModA
-> ModB
-> ModC
-> ModB
-> ModC
DFS with the visited check will return:
ModA
-> ModB_UNIQUIFIED
-> ModC_UNIQUIFIED
-> ModB
-> ModC
This should actually be done using a BFS, so that all instances of ModB get changed to ModB_UNIQUIFIED, then, ModC.
Regarding plusarg_reader.v missing, I don't see it in the .model.f
file, so it doesn't get checked. This points to a potential bug in split-module-files.py
, which I think is here, where the model_mods set should not fully subtract the dut_mods set.
from chipyard.
Related Issues (20)
- lnuma not found? HOT 10
- sbt.librarymanagement.ResolveException: Error downloading org.scalameta:semanticdb-scalac_2.13.10:4.3.22 HOT 1
- Docker build fail HOT 1
- ENABLE_CUSTOM_FIRRTL_PASS changes inferred SRAMs
- Improve Xcelium support
- Unnormal Area of Branch Predictor in BOOM HOT 1
- Readd Gemmini to `commit-on-master` check
- MMIO and front bus port not generated in MMIOScratchpadOnlyRocketConfig HOT 9
- Link errors when using external tools
- Single Gemmini with Multicore
- chipyard.config.WithTileFrequency not working in 1.9.0 HOT 5
- SBT Maven Download Error HOT 3
- Use off-chip clock for serial-tl
- error occurred in "./build-setup.sh riscv-tools" for the 1.9.0 HOT 13
- `make sim-rtl` fails due to redeclaration of modules HOT 3
- vcu118 verilog genration failed in chipyard repository HOT 3
- No axi4_fbus ports HOT 1
- VCS compiliation errors with VLSI flow HOT 2
- How to Compile C code for Hwacha Compiler
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from chipyard.