// Note: Set ENABLE_LIBYOSYS=1 in Makefile or Makefile.conf to build libyosys.so // yosys-config --exec --cxx -o demomain --cxxflags --ldflags demomain.cc -lyosys -lstdc++ #include int main() { Yosys::log_streams.push_back(&std::cout); Yosys::log_error_stderr = true; Yosys::yosys_setup(); Yosys::yosys_banner(); Yosys::run_pass("read_verilog example.v"); Yosys::run_pass("synth -noabc"); Yosys::run_pass("clean -purge"); Yosys::run_pass("write_blif example.blif"); Yosys::yosys_shutdown(); return 0; }
aboutsummaryrefslogtreecommitdiffstats
blob: ef3289149f689a8fb9e552020545a7b10e62bbc6 (plain)
1
2
3
4
5
6
7
#!/usr/bin/env bash
set -ex
yosys -p "tcl ../synth/synth_generic.tcl 4 blinky.json" blinky.v
${NEXTPNR:-../../nextpnr-generic} --no-iobs --pre-pack simple.py --pre-place simple_timing.py --json blinky.json --post-route bitstream.py --write pnrblinky.json
yosys -p "read_json pnrblinky.json; write_verilog -noattr -norename pnrblinky.v"
iverilog -o blinky_simtest ../synth/prims.v blinky_tb.v pnrblinky.v
vvp -N ./blinky_simtest