Anlogic FPGA ModelSim Simulation Analysis Skill
Use this skill after anlogic-testbench and before anlogic-wave-signal-analyzer.
Role
Turn verification inputs into a clear pass, fail, or blocked simulation conclusion with preserved waveform artifacts.
Inputs
- the latest
doc/stage-S2-summary.md
- testbench top
- stimulus and checker logic
- pass/fail criteria
- required compile order
run.do and wave.do inputs
Boundaries
- do not rewrite RTL design intent directly
- do not create the TD project
- do not treat script success as proof that function correctness is proven
Outputs
- pass/fail/block conclusion
- preserved waveform artifacts
doc/stage-S3-summary.md
Not Doing
- not forwarding full transcripts when a compact artifact summary is enough
Upstream Inputs
Prefer inputs from anlogic-testbench:
- testbench top
- stimulus and checker logic
- pass/fail criteria
- required compile order
run.do and wave.do inputs
If these inputs are incomplete, route back to anlogic-testbench instead of forcing a simulation conclusion.
Responsibilities
- Organize
vlog compile order and simulation library mapping
- Generate or repair
run.do and wave.do
- Run ModelSim and state whether the result is pass, fail, or blocked
- Preserve simulation artifacts for downstream extraction and comparison
- Export
.vcd from .wlf when the downstream flow needs waveform analysis
- Judge whether failures belong to script setup, testbench input quality, or RTL design assumptions
Not Responsible For
- Do not rewrite RTL design intent directly
- Do not create the TD project
- Do not treat script success as proof that function correctness is proven
Fixed Paths
- ModelSim:
D:/work/Modelsim/2020.4/win64/modelsim.exe
- Typical Anlogic simulation libraries:
D:/work/Modelsim/2020.4/anlogic/621
- TD references:
D:/work/TD/6.2.1/template and D:/work/TD/6.2.1/sim_release
Standard Workflow
- Confirm testbench deliverables and pass/fail criteria are complete.
- Prepare ordered compile commands and library mapping.
- Ensure
run.do calls wave.do.
- Run simulation and preserve
work/, transcript, and .wlf.
- If waveform comparison is required, export
.vcd from .wlf.
- Decide whether the stage is pass, fail, or blocked.
- Hand off to
anlogic-wave-signal-analyzer only when the waveform artifacts are usable.
Required Artifacts
Every handoff-ready simulation directory must preserve:
compile.f when that file is part of the project flow
run.do
wave.do
work/
transcript
vsim.wlf or a renamed <case>.wlf
Do not auto-delete these artifacts at the end of the run.
WLF And VCD Rules
- Always keep the
.wlf artifact after simulation.
- Default filename is
vsim.wlf, but a clearer <case>.wlf name is allowed.
- When the next stage needs signal extraction, export
.vcd with:
wlf2vcd -o .\wave.vcd .\vsim.wlf
- The simulation conclusion must explicitly say:
- whether
.wlf was preserved
- whether
.vcd was exported successfully
- where the artifacts were saved
- whether the flow may enter
anlogic-wave-signal-analyzer
Handoff Gate
Do not release this stage unless all of the following are true:
- compilation and load status are known
- pass/fail/block status is stated
- artifact freshness is stated
.wlf retention is confirmed
.vcd export status is stated when waveform analysis is expected
- fixed summary fields:
current_stage
goal
confirmed_constraints
artifacts
decision
blocking_reason
next_action
Routing Rules
- Missing stimulus, checker, or pass/fail criteria: go back to
anlogic-testbench
- Missing simulation models, compile list, or library mapping: go back to
anlogic-testbench
- RTL structure, interface, or primitive assumptions are wrong: go back to
anlogic-code-design
.wlf missing or .vcd export unusable: stay in this skill until artifacts are usable
- Simulation and waveform artifacts are ready: hand off to
anlogic-wave-signal-analyzer
Strong Rules
- Keep the user-preferred script style when a known
run.do, test.do, or grouped wave.do style already exists.
- Do not add default cleanup such as
vdel -lib work -all.
- A simulation handoff is incomplete if
wave.do is missing or unusable.
- A project must not proceed to
anlogic-project-creation until the later anlogic-signal-comparison stage also passes.
References
- references/simulation-stage-map.md
- references/modelsim_config.md
- references/report_template.md
- references/wave-artifact-handoff.md
2026-05-06 Rule: Local Anlogic Library And Sim Resource Completeness
- Do not treat a simulation directory as handoff-ready if it depends on accidental global ModelSim mappings that are not preserved in the project.
- Prefer a project-local
modelsim.ini or equivalent local mapping file when vendor libraries such as common, ph1p, or other Anlogic primitive libraries are required.
- If the transcript shows unresolved
glbl, PH1P_* primitives, or similar vendor primitive load failures, keep the issue in this skill and repair library mapping before routing back to RTL.
- If the design depends on side resources such as DDR PHY ROM text or memory-init collateral, preserve those files in the simulation project and call them out explicitly in the stage conclusion.
- A stage conclusion must say whether vendor-library mapping was localized successfully and whether all required sim side resources were present.
1---2name: anlogic-modelsim3description: Use when Anlogic FPGA verification inputs are ready and Codex needs to run ModelSim, organize `run.do` plus `wave.do`, preserve waveform artifacts, export `.vcd` from `.wlf`, and produce a pass/fail/block conclusion that is valid for downstream waveform extraction and signal comparison.4---56# Anlogic FPGA ModelSim Simulation Analysis Skill78Use this skill after `anlogic-testbench` and before `anlogic-wave-signal-analyzer`.910## Role1112Turn verification inputs into a clear pass, fail, or blocked simulation conclusion with preserved waveform artifacts.1314## Inputs1516- the latest `doc/stage-S2-summary.md`17- testbench top18- stimulus and checker logic19- pass/fail criteria20- required compile order21- `run.do` and `wave.do` inputs2223## Boundaries2425- do not rewrite RTL design intent directly26- do not create the TD project27- do not treat script success as proof that function correctness is proven2829## Outputs3031- pass/fail/block conclusion32- preserved waveform artifacts33- `doc/stage-S3-summary.md`3435## Not Doing3637- not forwarding full transcripts when a compact artifact summary is enough3839## Upstream Inputs4041Prefer inputs from `anlogic-testbench`:42- testbench top43- stimulus and checker logic44- pass/fail criteria45- required compile order46- `run.do` and `wave.do` inputs4748If these inputs are incomplete, route back to `anlogic-testbench` instead of forcing a simulation conclusion.4950## Responsibilities5152- Organize `vlog` compile order and simulation library mapping53- Generate or repair `run.do` and `wave.do`54- Run ModelSim and state whether the result is pass, fail, or blocked55- Preserve simulation artifacts for downstream extraction and comparison56- Export `.vcd` from `.wlf` when the downstream flow needs waveform analysis57- Judge whether failures belong to script setup, testbench input quality, or RTL design assumptions5859## Not Responsible For6061- Do not rewrite RTL design intent directly62- Do not create the TD project63- Do not treat script success as proof that function correctness is proven6465## Fixed Paths6667- ModelSim: `D:/work/Modelsim/2020.4/win64/modelsim.exe`68- Typical Anlogic simulation libraries: `D:/work/Modelsim/2020.4/anlogic/621`69- TD references: `D:/work/TD/6.2.1/template` and `D:/work/TD/6.2.1/sim_release`7071## Standard Workflow72731. Confirm testbench deliverables and pass/fail criteria are complete.742. Prepare ordered compile commands and library mapping.753. Ensure `run.do` calls `wave.do`.764. Run simulation and preserve `work/`, `transcript`, and `.wlf`.775. If waveform comparison is required, export `.vcd` from `.wlf`.786. Decide whether the stage is pass, fail, or blocked.797. Hand off to `anlogic-wave-signal-analyzer` only when the waveform artifacts are usable.8081## Required Artifacts8283Every handoff-ready simulation directory must preserve:84- `compile.f` when that file is part of the project flow85- `run.do`86- `wave.do`87- `work/`88- `transcript`89- `vsim.wlf` or a renamed `<case>.wlf`9091Do not auto-delete these artifacts at the end of the run.9293## WLF And VCD Rules9495- Always keep the `.wlf` artifact after simulation.96- Default filename is `vsim.wlf`, but a clearer `<case>.wlf` name is allowed.97- When the next stage needs signal extraction, export `.vcd` with:9899```powershell100wlf2vcd -o .\wave.vcd .\vsim.wlf101```102103- The simulation conclusion must explicitly say:104 - whether `.wlf` was preserved105 - whether `.vcd` was exported successfully106 - where the artifacts were saved107 - whether the flow may enter `anlogic-wave-signal-analyzer`108109## Handoff Gate110111Do not release this stage unless all of the following are true:112- compilation and load status are known113- pass/fail/block status is stated114- artifact freshness is stated115- `.wlf` retention is confirmed116- `.vcd` export status is stated when waveform analysis is expected117- fixed summary fields:118 - `current_stage`119 - `goal`120 - `confirmed_constraints`121 - `artifacts`122 - `decision`123 - `blocking_reason`124 - `next_action`125126## Routing Rules127128- Missing stimulus, checker, or pass/fail criteria: go back to `anlogic-testbench`129- Missing simulation models, compile list, or library mapping: go back to `anlogic-testbench`130- RTL structure, interface, or primitive assumptions are wrong: go back to `anlogic-code-design`131- `.wlf` missing or `.vcd` export unusable: stay in this skill until artifacts are usable132- Simulation and waveform artifacts are ready: hand off to `anlogic-wave-signal-analyzer`133134## Strong Rules135136- Keep the user-preferred script style when a known `run.do`, `test.do`, or grouped `wave.do` style already exists.137- Do not add default cleanup such as `vdel -lib work -all`.138- A simulation handoff is incomplete if `wave.do` is missing or unusable.139- A project must not proceed to `anlogic-project-creation` until the later `anlogic-signal-comparison` stage also passes.140141## References142143- [references/simulation-stage-map.md](references/simulation-stage-map.md)144- [references/modelsim_config.md](references/modelsim_config.md)145- [references/report_template.md](references/report_template.md)146- [references/wave-artifact-handoff.md](references/wave-artifact-handoff.md)147148## 2026-05-06 Rule: Local Anlogic Library And Sim Resource Completeness149150- Do not treat a simulation directory as handoff-ready if it depends on accidental global ModelSim mappings that are not preserved in the project.151- Prefer a project-local `modelsim.ini` or equivalent local mapping file when vendor libraries such as `common`, `ph1p`, or other Anlogic primitive libraries are required.152- If the transcript shows unresolved `glbl`, `PH1P_*` primitives, or similar vendor primitive load failures, keep the issue in this skill and repair library mapping before routing back to RTL.153- If the design depends on side resources such as DDR PHY ROM text or memory-init collateral, preserve those files in the simulation project and call them out explicitly in the stage conclusion.154- A stage conclusion must say whether vendor-library mapping was localized successfully and whether all required sim side resources were present.