- Documentation
- Simulation
- Simulating a design
Simulating a design
--simulate-build generates a C++ model of your hardware and links it with the main() in the same source.
flux --simulate-build counter_test.flux -o counter_test./counter_testRun the build from the Flux repository root so the src/flux/ includes resolve. The command will not overwrite an existing output file; remove it first.
Simulator interface
Section titled “Simulator interface”| Call | Purpose |
|---|---|
createClock(name, period) |
Make a clock with a period |
instantiate(module, clocks) |
Create an instance, naming its clock ports |
setInput(instance, port, value) |
Drive an input |
runFor(duration) |
Advance time |
getOutput<T>(instance, port) |
Read an output |
Values are unsigned and at most 64 bits wide.
What simulation does not show
Section titled “What simulation does not show”The model checks logical behavior. It does not check timing, placement, routing, pin wiring or anything electrical. There is no waveform output yet.