Compare commits

...

281 Commits

Author SHA1 Message Date
Paul Mackerras 35e0dbed34
Merge pull request #353 from tianrui-wei/master 12 months ago
Michael Neuling cd52390bf1
Merge pull request #373 from antonblanchard/icache-insn-u-state 12 months ago
Michael Neuling b983d5080e
Merge pull request #376 from antonblanchard/loadstore-init 12 months ago
Michael Neuling d4db331467
Merge pull request #374 from antonblanchard/icache-unused-sig 12 months ago
Michael Neuling ee5e3778ed
Merge pull request #364 from shenki/readme-updates 12 months ago
Michael Neuling c43692f4c7
Merge pull request #372 from antonblanchard/dcache-unused-sig 12 months ago
Michael Neuling 956df2c863
Merge pull request #371 from antonblanchard/unused-sig 12 months ago
Michael Neuling 3627f102db
Merge pull request #370 from antonblanchard/divider-init 12 months ago
Paul Mackerras 6e1e763c02
Merge pull request #368 from antonblanchard/icache-pmu-events 12 months ago
Anton Blanchard 1047239a37
Merge pull request #377 from antonblanchard/fpu-init 12 months ago
Anton Blanchard 9d35340bb1 fpu: Reduce uninitialised signals 12 months ago
Michael Neuling b82eea5933
Merge pull request #366 from antonblanchard/hello-world-bss 12 months ago
Anton Blanchard d3aff67fa7
Merge pull request #375 from antonblanchard/core_debug-init 12 months ago
Anton Blanchard b47b71821e loadstore1: reduce U state being output 12 months ago
Anton Blanchard 71d4b5ed20 core_debug: Initialise gspr_index 12 months ago
Anton Blanchard a527d9b959 core: Remove unused icache_inv signal 12 months ago
Anton Blanchard e7f0a7c7ac icache: Don't output X on i_out.insn 12 months ago
Anton Blanchard 39220be311 dcache: remove unused do_write signal 12 months ago
Anton Blanchard 843361f2be execute1: sub_mux_sel and result_mux_sel are unused 12 months ago
Anton Blanchard d3a7517318 divider: Fix d_out.overflow U state issue 12 months ago
Anton Blanchard 1ff852b012
Merge pull request #369 from antonblanchard/loadstore-pmu-init 12 months ago
Anton Blanchard e2438071a1 loadstore1: Initialise PMU events 12 months ago
Anton Blanchard b7c4d3c5c3
Merge pull request #367 from antonblanchard/fpu-typo 12 months ago
Anton Blanchard f06abb67ad icache: Hook up PMU events 12 months ago
Anton Blanchard 64d2def0c6 fpu: Fix capitalisation of Execute1ToFPUType 12 months ago
Anton Blanchard ff442d1bdb Zero BSS in hello world test 12 months ago
Anton Blanchard b8fc5636a4
Merge pull request #365 from antonblanchard/less-fpga-init 12 months ago
Anton Blanchard ebdddcc402 Remove some FPGA style signal inits 12 months ago
Anton Blanchard a750365ffa Remove some FPGA style signal inits 12 months ago
Joel Stanley 9ec22af256 README: Add Linux on Microwatt instructions 12 months ago
Joel Stanley a31725d989 README: Add uart to fusesoc instructions 12 months ago
Michael Neuling f5e06c2d4b
Merge pull request #361 from antonblanchard/alt-reset-address 1 year ago
Anton Blanchard 948f6f43a7 Allow ALT_RESET_ADDRESS to be overridden 1 year ago
Michael Neuling 8bf48ac094
Merge pull request #360 from antonblanchard/log2ceil-issue 1 year ago
Anton Blanchard b5accb78b2 wishbone_bram_wrapper ram_addr_bits is 1 bit off 1 year ago
Michael Neuling 30fd936c12
Merge pull request #358 from antonblanchard/unused-sig 1 year ago
Michael Neuling af1b76d944
Merge pull request #356 from antonblanchard/fpu-constant 1 year ago
Michael Neuling 9b96ab730c
Merge pull request #357 from antonblanchard/xics-warning 1 year ago
Anton Blanchard 0b39947f8d Remove unused sequential signal from Fetch1ToIcacheType 1 year ago
Anton Blanchard 00bf0af21c xics: Fix warning when comparing two std_ulogic_vectors 1 year ago
Anton Blanchard 50b4cb9423 fpu: Make inverse_table a constant 1 year ago
Tianrui Wei 844ca0e6b5
fix: fix icache_tb not finishing correctly 1 year ago
Michael Neuling f01f3d233a
Merge pull request #352 from mkj/static-urjtag 1 year ago
Matt Johnston c0c00d05bc mw_debug: Add STATIC_URJTAG flag 1 year ago
Michael Neuling ffcdaaa92d
Update the README Issues (#350) 1 year ago
Michael Neuling b4770197a2
Merge pull request #349 from madscientist159/master 1 year ago
Raptor Engineering Development Team fcb783a0fb Extend LiteDRAM VHDL wrapper to allow more than one clock line 1 year ago
Michael Neuling 2b97fb0bf3
Merge pull request #348 from paulusmack/reduce 1 year ago
Paul Mackerras 0aa898c7a6 xics: Rework the irq_gen process 1 year ago
Paul Mackerras 1720a0584a Use alternative count-leading-zeroes algorithm in the FPU and LSU 1 year ago
Paul Mackerras 1086988883 countzero: Use alternative algorithm for higher bits 1 year ago
Paul Mackerras 4cf2921b0b soc: Re-do peripheral address decode to improve timing 1 year ago
Michael Neuling 27b660ef76
Merge pull request #346 from mkj/dmi_ecp5 1 year ago
Anton Blanchard 5a5a082601
Merge pull request #343 from mikey/orange-crab-ci 1 year ago
Matt Johnston 9c64f8a98b mw_debug: Add Lattice ECP5 support 1 year ago
Matt Johnston 3775650df3 dmi_dtm_ecp5: Use ECP5 JTAGG for DMI 1 year ago
Matt Johnston eb20195a10 mw_debug: Link urjtag statically 1 year ago
Matt Johnston 763138798e mw_debug: use isxdigit for hex arguments 1 year ago
Matt Johnston 04cc4a842c mw_debug: Add -s frequency argument 1 year ago
Matt Johnston e05ae0c8cb mw_debug: pass target parameters to urjtag 1 year ago
Paul Mackerras 49ec80ac3e fetch1/icache1: Remove the use_previous logic 1 year ago
Paul Mackerras cef3660e74
Merge pull request #345 from antonblanchard/popcnt-go-fast 1 year ago
Paul Mackerras 2491aa7fc5 core: Make popcnt* take two cycles 1 year ago
Michael Neuling 286757f0f7 ci: Add new Orange Crab build 1 year ago
Michael Neuling 6ff3b2499c
Merge pull request #342 from mkj/orangecrab-merge 1 year ago
Michael Neuling cdd661d844
Merge branch 'master' into orangecrab-merge 1 year ago
Michael Neuling fda8879e2f
Merge pull request #341 from mkj/progtools 1 year ago
Michael Neuling ffbf2f9964
Merge pull request #340 from mkj/orangecrab-ghdl-plugin 1 year ago
Matt Johnston 049f0549d8 orangecrab: Fix sdcard wishbone addressing 1 year ago
Matt Johnston abc6a4f372 orangecrab: use litesdcard 1 year ago
Matt Johnston 42959184dd litesdcard: add lattice, regenerate 1 year ago
Matt Johnston d794cc70b1 orangecrab: No BTC, LOG_LENGTH, dram NUM_LINES 1 year ago
Matt Johnston a8d9203c5d orangecrab: Use litedram 1 year ago
Matt Johnston 57d4c4c117 orangecrab: set HAS_SHORT_MULT 1 year ago
Matt Johnston a9b467f43b orangecrab: add Orange Crab r0.2 target 1 year ago
Matt Johnston 8901e84d8d litedram: Add orangecrab-85-0.2 target 1 year ago
Matt Johnston 08021ae28e litedram: set Makefile -Werror 1 year ago
Matt Johnston 5a3cdc8b22 litedram: disable block_until_ready, regenerate 1 year ago
Matt Johnston 5e90133b61 Makefile: add ecpprog targets 1 year ago
Matt Johnston 7761bf8b71 Makefile: Add DFU programming 1 year ago
Matt Johnston 2ec0d5fccd Makefile: detect when ghdl is a yosys plugin 1 year ago
Anton Blanchard 67164a6ffa
Merge pull request #338 from shenki/yosys-read-verilog 1 year ago
Joel Stanley 9ceb463957 Makefile: Use read_verilog with yosys 1 year ago
Michael Neuling 7fa7b45faa
Merge pull request #337 from paulusmack/fixes 2 years ago
Paul Mackerras d458b5845c ECP5: Adjust PLL constants so the PLL lock indication works 2 years ago
Michael Neuling 8a030502a2
Merge pull request #336 from paulusmack/fixes 2 years ago
Paul Mackerras a5c9b3c412 Makefile: Add a target for the Orange Crab v0.21 with LFE5U-85F 2 years ago
Michael Neuling 9cbe1f4a17
Merge pull request #334 from antonblanchard/icbi-issue 2 years ago
Anton Blanchard 099862bee9
Merge pull request #335 from ozbenh/misc 2 years ago
Benjamin Herrenschmidt e675eba0df icache: req_laddr becomes req_raddr 2 years ago
Benjamin Herrenschmidt 5cfa65e836 Introduce addr_to_wb() and wb_to_addr() helpers 2 years ago
Benjamin Herrenschmidt d745995207 Introduce real_addr_t and addr_to_real() 2 years ago
Anton Blanchard 2d142a6c01 tests/misc: Add a store/dcbz test 2 years ago
Anton Blanchard 00259458c7 tests/misc: Add an icbi test 2 years ago
Anton Blanchard 13439c76ba
Merge pull request #333 from ozbenh/wukong 2 years ago
Benjamin Herrenschmidt d564672a82 Regenerate litedram and liteeth 2 years ago
Benjamin Herrenschmidt da0189af1e Add support for QMTech Wukong v2 board 2 years ago
Benjamin Herrenschmidt 621a0f6b28 fpga/clk_gen_plle2: Add support for 50Mhz->100Mhz 2 years ago
Benjamin Herrenschmidt 4b1a413a2f Add support for more spansion flash 2 years ago
Anton Blanchard c7579d74b0
Merge pull request #332 from paulusmack/fixes 2 years ago
Paul Mackerras 70270c066a dcache: Fix bug with dcbz closely following stores with the same tag 2 years ago
Paul Mackerras 9b3b57710a icache: Fix icache invalidation 2 years ago
Paul Mackerras 83dea94793 decode1: Conditional trap instructions don't need to be single-issue 2 years ago
Paul Mackerras 9aaa6d3ca3
Merge pull request #330 from antonblanchard/orange-crab-freq 2 years ago
Anton Blanchard 537e446562
Merge pull request #331 from ozbenh/misc 2 years ago
Benjamin Herrenschmidt e6cb72fcd9 Add liteeth/build to gitignore 2 years ago
Benjamin Herrenschmidt b557ec3a05 mw_debug: Default to jtag backend if unspecified 2 years ago
Benjamin Herrenschmidt 4bdfef9a20 mw_debug: Probe cable if unspecified 2 years ago
Benjamin Herrenschmidt 814d6914d0 flash-arty: Add cable argument 2 years ago
Anton Blanchard af6bc48d36
Merge pull request #329 from paulusmack/wb-fix 2 years ago
Anton Blanchard 06266fe84a Orange Crab is 48MHz not 50MHz, bump PLL frequency 2 years ago
Michael Neuling 0a415410c9
Merge pull request #328 from paulusmack/shortmult 2 years ago
Michael Neuling c2f5db6fca
Merge pull request #327 from paulusmack/master 2 years ago
Paul Mackerras ca4eb46aea Make wishbone addresses be in units of doublewords or words 2 years ago
Paul Mackerras 734e4c4a52 core: Add a short multiplier 2 years ago
Paul Mackerras bb5f356386 loadstore1: Make r1.req.addr not depend on l_in.valid 2 years ago
Michael Neuling 2224b28c2c
Merge pull request #324 from paulusmack/master 2 years ago
Paul Mackerras 54b0e8b8c8 core: Predict not-taken conditional branches using BTC 2 years ago
Paul Mackerras 0cdaa2778f xilinx-mult: Move some registers later in the data flow 2 years ago
Paul Mackerras 77d9891d2f
Merge pull request #326 from antonblanchard/dcache-nc-fix 2 years ago
Anton Blanchard 39e1d10069
Merge pull request #325 from paulusmack/fixes 2 years ago
Anton Blanchard b29c58f3d1 dcache: Loads from non-cacheable PTEs load entire 64 bits 2 years ago
Paul Mackerras d4cfdb1bfe decode1: Fix form of isel marked as single-issue 2 years ago
Michael Neuling 09bd01a49e
Merge pull request #323 from paulusmack/fixes 2 years ago
Paul Mackerras 06e07c69a8 decode1: Fix maddld and maddhdu to not set CR0 2 years ago
Paul Mackerras a68921edca core: Fix mcrxrx, addpcis and bpermd 2 years ago
Michael Neuling 18eb029f0a
Merge pull request #322 from paulusmack/fixes 2 years ago
Paul Mackerras ba34914465 tests/misc: Add a test for a load that hits two preceding stores 2 years ago
Paul Mackerras 0b23a5e760 dcache: Simplify data input to improve timing 2 years ago
Paul Mackerras 1a9834c506 dcache: Fix bug with forwarding of stores 2 years ago
Paul Mackerras f812832ad7 dcache: Move way selection and forwarding earlier 2 years ago
Michael Neuling a9e6263aab
Merge pull request #319 from antonblanchard/verilator-ci 2 years ago
Michael Neuling 8bbb0018b4
Merge pull request #318 from paulusmack/pmu 2 years ago
Michael Neuling 05fe709ffc
Merge pull request #320 from antonblanchard/litedram-regenerate 2 years ago
Anton Blanchard c0f7f54276 litedram: Regenerate from upstream litex 2 years ago
Anton Blanchard ee38a31152 ci: Add verilator tests 2 years ago
Anton Blanchard c81583c128 makefile: Check environment for MEMORY_SIZE/RAM_INIT_FILE 2 years ago
Anton Blanchard efb387b0d2 makefile: Add some verilator micropython tests 2 years ago
Anton Blanchard 8acd5a5607 verilator: Specify top level module 2 years ago
Anton Blanchard 7e2de602ee makefile: Simplify microwatt-verilator target, add Docker image 2 years ago
Paul Mackerras 65c43b488b PMU: Add several more events 2 years ago
Paul Mackerras 8cdb00652b
Merge pull request #316 from antonblanchard/verilator-fix 2 years ago
Paul Mackerras 71af8016da
Merge pull request #317 from antonblanchard/gpio-fix 2 years ago
Paul Mackerras e33fb26e7a PMU: Fix PMC5/6 behaviour when MMCR0[PMCC] = 11 2 years ago
Anton Blanchard 591e96d1a2 gpio: Add HAS_GPIO to avoid verilator build errors 2 years ago
Anton Blanchard bc0f7cf236 Rename 'do' signal to avoid verilator System Verilog warning 2 years ago
Michael Neuling 2bd00f5119
Merge pull request #315 from paulusmack/pmu 2 years ago
Paul Mackerras 1896e5f803
Merge pull request #314 from antonblanchard/yosys-go-fast-bits 2 years ago
Michael Neuling 400e481ffa
Merge pull request #313 from paulusmack/fixes 2 years ago
Paul Mackerras a7873b45f7 core: Add a basic performance monitor unit (PMU) implementation 2 years ago
Anton Blanchard 6254bb5ee9 Reduce Yosys ECP5 cell usage by 30% with -abc9 -nowidelut 2 years ago
Michael Neuling aa4e4e77c4
Merge pull request #311 from antonblanchard/litesdcard-nexys-video 2 years ago
Michael Neuling 65c131e89f
Merge pull request #312 from shenki/sdcard-soc-features 2 years ago
Paul Mackerras f40842d9b2 tests/fpu: Test FPU unavailable interrupt following a load 2 years ago
Joel Stanley bc3995804f litedram: Add sdcard to soc features 2 years ago
Paul Mackerras 64e3ce7134 execute1: Handle interrupts during sequences of load/store operations 2 years ago
Anton Blanchard 7cfbcd5514 litesdcard: Add Nexys Video support 2 years ago
Anton Blanchard 9caaa3fc46 litesdcard: Use vendor not board type 2 years ago
Paul Mackerras c198b2b82e
Merge pull request #310 from antonblanchard/liteeth-update-2 2 years ago
Anton Blanchard 34e10cc52c liteeth: Regenerate from upstream litex 2 years ago
Anton Blanchard 12efb51bcc liteeth: Update yaml config 2 years ago
Anton Blanchard 458dfe01a6 Add liteeth support to Nexys Video 2 years ago
Michael Neuling cf6df4f17f
Merge pull request #307 from antonblanchard/litedram-update 2 years ago
Michael Neuling 69a1440204
Merge pull request #309 from antonblanchard/clk-cleanup 2 years ago
Michael Neuling b885ee7ed1
Merge pull request #308 from antonblanchard/small-fixes 2 years ago
Anton Blanchard 75e06a1e30 Remove -add from xdc files 2 years ago
Anton Blanchard 187199c489 Remove -waveform from xdc files 2 years ago
Anton Blanchard 7994b98404 Fix some whitespace issues 2 years ago
Anton Blanchard 46cde3bb23
Merge pull request #305 from mikey/noflatten 2 years ago
Anton Blanchard 780d6c754c litedram: Regenerate from upstream litex 2 years ago
Anton Blanchard 07f2edc415 litedram: sdrinit() is now sdram_init() 2 years ago
Anton Blanchard 346686feb8 litedram: Fix compiler warning 2 years ago
Anton Blanchard ac546a3024 litedram: Update yaml files 2 years ago
Anton Blanchard 6034a9e31f litedram: simplify generate.py 2 years ago
Anton Blanchard 3275304a7f litedram: Remove variables.mak 2 years ago
Michael Neuling d6efbb327f ci: Remove noflatten to reduce size of ECP5 builds 2 years ago
Anton Blanchard 0199ff8ca8
Merge pull request #299 from mikey/vunit-make 2 years ago
Michael Neuling 25ab1053e9
Merge pull request #304 from umarcor/ci-backends 2 years ago
umarcor de41dfc703 ci: test 'build' with LLVM and GCC backends 2 years ago
Michael Neuling 0cd826d190
Merge pull request #301 from umarcor/vunit-cleanup 2 years ago
Michael Neuling bf76261979 makefile: Add check_vunit 2 years ago
umarcor 178c2a7da3 VUnit: style 2 years ago
umarcor 2031c6d2d2 VUnit: use Path.glob instead of glob.glob 2 years ago
umarcor 7571416f81 ci: add 'workflow_dispatch' 2 years ago
umarcor faf8309629 ci: in job 'VUnit' use a container step instead of a container job 2 years ago
Michael Neuling d7458d5beb
Reduce the size of icache to help yosys ECP5 builds (#303) 2 years ago
Michael Neuling f9654428ff
Merge pull request #296 from LarsAsplund/logging-checking 2 years ago
Michael Neuling 9e3c756234
Merge pull request #298 from paulusmack/master 2 years ago
Michael Neuling ff7421c54e
Merge pull request #295 from LarsAsplund/master 2 years ago
Paul Mackerras 18120f153d MMU: Implement a vestigial partition table 2 years ago
Lars Asplund 478b787c10 Replaced VHDL assert and report with VUnit checking and logging 2 years ago
Lars Asplund 0865704e21 Run VUnit tests in CI 2 years ago
Lars Asplund 0940b8a9d3 Organized VUnit testbenches into test cases. 2 years ago
Lars Asplund 08c0c4c1b4 Make core testbenches recognized by VUnit 2 years ago
Lars Asplund 41d57e6148 Added VUnit run script. 2 years ago
Michael Neuling 84473eda1b Merge pull request #277 from paulus/gpio 2 years ago
Michael Neuling 7f44980611
Merge pull request #287 from paulusmack/master 2 years ago
Paul Mackerras d8ea64675a
Merge pull request #278 from shenki/openocd-v0.11 2 years ago
Joel Stanley 0d4a0bab6e openocd: Fix verify command for v0.10 2 years ago
Paul Mackerras 21ed730514 arty_a7: Add litesdcard interface 2 years ago
Paul Mackerras 231003f7c7 icache: Snoop writes to memory by other agents 2 years ago
Paul Mackerras 4c11c9c661 dcache: Simplify logic in RELOAD_WAIT_ACK state 2 years ago
Paul Mackerras eb7eba2d92 dcache: Snoop writes to memory by other agents 2 years ago
Paul Mackerras 4a8ab3331c
Merge pull request #283 from antonblanchard/whitespace 2 years ago
Antony Vennard d9a398dc81
Update documentation. (#280) 2 years ago
Anton Blanchard 6d827b9358
Merge pull request #286 from antonblanchard/Makefile-cleanup-3 2 years ago
Anton Blanchard be11ebbf6d Remove unused GHDL_TARGET_GENERICS 2 years ago
Anton Blanchard 33c78f9282 Move verilator --trace flag into VERILATOR_FLAGS 2 years ago
Anton Blanchard 0af906232f
Merge pull request #285 from antonblanchard/Makefile-cleanup-2 2 years ago
Anton Blanchard 5cc5d8f030
Merge pull request #281 from antonblanchard/cache-tlb-parameters 2 years ago
Anton Blanchard 4ab36517ec Remove -frelaxed 2 years ago
Anton Blanchard 561d6af6f0 Use VERILATOR_FLAGS/VERILATOR_CFLAGS on all verilator targets 2 years ago
Anton Blanchard 75da4156fe Remove core_files from soc_files and fpga_files 2 years ago
Anton Blanchard ef01fa32bd
Merge pull request #284 from antonblanchard/boot-clocks 2 years ago
Anton Blanchard af462f0ca9 Reformat spi_flash_ctrl 2 years ago
Anton Blanchard 2db89628ab Reformat control 2 years ago
Anton Blanchard 21f482f967 Reformat testbenches 2 years ago
Anton Blanchard 0d86580ac7 Reformat writeback 2 years ago
Anton Blanchard f67b143165 Reformat plru 2 years ago
Anton Blanchard c76e638a77 Reformat rotator 2 years ago
Anton Blanchard 601f3211be Reformat divider 2 years ago
Anton Blanchard bf96279ff1 Reformat countzero 2 years ago
Anton Blanchard af7e330d69 Reformat cr_file 2 years ago
Anton Blanchard 9208276aa2 Reformat register_file 2 years ago
Anton Blanchard 74254bf11a Reformat cache_ram 2 years ago
Anton Blanchard 91a53d8001 Allow SPI BOOT_CLOCKS to be overridden by top level 2 years ago
Anton Blanchard 2d21b95f87 Pass icache/dcache/tlb parameters down from soc 2 years ago
Paul Mackerras f06a0f4e5a arty: Update GPIOs for Boxarty BMC 2 years ago
Joel Stanley 24a34899b4 Add files for openocd v0.11 2 years ago
Paul Mackerras f06ffcf9b7 Add a GPIO controller and use it to drive the shield I/O pins on the Arty 2 years ago
Michael Neuling 6523acc743
Merge pull request #274 from mikey/read-sprs 2 years ago
Anton Blanchard d26a157cd7 Add a test to read from all SPRs 2 years ago
Michael Neuling 4c21587c4d Fix DAR/DSISR reading before they are written 2 years ago
Michael Neuling 6c7689052d
Merge pull request #269 from paulusmack/pipeline 2 years ago
Michael Neuling 9a6a7e9fe5
Merge pull request #268 from paulusmack/btc 2 years ago
Michael Neuling 7652452367
Merge pull request #273 from antonblanchard/wishbone-checking 2 years ago
Michael Neuling c4e3ade4ed
Merge pull request #267 from paulusmack/master 2 years ago
Anton Blanchard 481f3cdfea Add some wishbone checking 2 years ago
Paul Mackerras 17fd069640 core: Allow multiple loadstore instructions to be in flight 2 years ago
Paul Mackerras f583d088b7 loadstore: Convert to 3-stage pipeline 2 years ago
Paul Mackerras f636bb7c39 dcache: Fix bugs in pipelined operation 2 years ago
Paul Mackerras acb3d2d745 core: Send FPU interrupts to writeback rather than execute1 2 years ago
Paul Mackerras 29221315e9 core: Send loadstore1 interrupts to writeback rather than execute1 2 years ago
Paul Mackerras 3cd3449b4b core: Move redirect and interrupt delivery logic to writeback 2 years ago
Paul Mackerras 4fd8d9509c execute1: Move CR result to data path process 2 years ago
Paul Mackerras d6ac43251a execute1: Move data-path logic out to a separate process 2 years ago
Paul Mackerras ae2afeca5c core: Track CR hazards and bypasses using tags 2 years ago
Paul Mackerras d290d2a9bb core: Restore bypass path from execute1 2 years ago
Paul Mackerras c0b45e153b core: Track GPR hazards using tags that propagate through the pipelines 2 years ago
Paul Mackerras a1d7b54f76 core: Crack branches that update both CTR and LR 2 years ago
Paul Mackerras 4c61a71a62 core: Crack update-form loads into two internal ops 2 years ago
Paul Mackerras 0fb207be60 fetch1: Implement a simple branch target cache 2 years ago
Paul Mackerras f7b855dfc3 execute1: Improve timing on comparisons 2 years ago
Paul Mackerras b0510fd1bb core: Reorganize execute1 2 years ago
Paul Mackerras c0f282b691 decode1: Implement tlbsync as a no-op 2 years ago
Paul Mackerras 658feabfd4 core: Make result multiplexing explicit 2 years ago
Paul Mackerras d6134babc0 decode1: Implement obsolete dst, dstst, dss instructions as no-ops 2 years ago
Paul Mackerras 9ea1ab0215 execute1: Move branch adder after register 2 years ago
Paul Mackerras 89a67a18d0 decode: Add a facility field to the instruction decode tables 2 years ago
Paul Mackerras cb1e3f6d70 decode1: Take an extra cycle for predicted branch redirects 2 years ago
Paul Mackerras ec5730a75a tests: Add tests for lq/stq and lqarx/stqcx. 2 years ago
Paul Mackerras 6427cab46f loadstore1/dcache: Send store data one cycle later 2 years ago
Paul Mackerras 4b2c23703c core: Implement quadword loads and stores 2 years ago
Paul Mackerras d1f35705c0 loadstore1: Improve timing of data path from cache RAM to writeback 2 years ago
Paul Mackerras 784d409999 dcache: Add more commentary, no code change 2 years ago
Paul Mackerras 54f89afab7 loadstore1: Decide on load formatting controls a cycle earlier 2 years ago
Paul Mackerras 55f7d99376 decode1: Fix decoding of recommended NOP instruction 2 years ago
Paul Mackerras 3361c460b8 core_debug: Stop logging 256 cycles after trigger 2 years ago
Paul Mackerras 470f1b2140 core_debug: Add an address trigger to stop logging at a given address 2 years ago
Paul Mackerras 5535257c71 FPU: Don't use mask generator for rounding 2 years ago
Paul Mackerras 45c5236700 FPU: Relax timing around multiplier output 2 years ago
Paul Mackerras f14e731ec6 mw_debug: Display terminated status when stopping 2 years ago
Paul Mackerras 6baf3b519f mw_debug: Extend to handle FPRs 2 years ago
Paul Mackerras 2be2440734 Arty A7: Document pin connections for on-board headers 2 years ago
Paul Mackerras d5cf4acfdb execute1: Update comments about XER forwarding 2 years ago
Paul Mackerras 5f8279a14a
Merge pull request #263 from antonblanchard/reset-pid 2 years ago
Paul Mackerras 45b7312e89
Merge pull request #262 from antonblanchard/reset-tb-decr 2 years ago
Paul Mackerras 00446a9169
Merge pull request #259 from antonblanchard/dmi-reset 2 years ago
Anton Blanchard 740f013284 Initialize PID register 2 years ago
Anton Blanchard e1bac4d6e7 Reset TB and DECR 2 years ago
Anton Blanchard 5eb351b4be Reset JTAG/DMI 2 years ago
  1. 36
      .github/workflows/test.yml
  2. 1
      .gitignore
  3. 150
      Makefile
  4. 81
      README.md
  5. 66
      cache_ram.vhdl
  6. 331
      common.vhdl
  7. 225
      constraints/orange-crab-0.2.lpf
  8. 301
      control.vhdl
  9. 89
      core.vhdl
  10. 207
      core_debug.vhdl
  11. 51
      core_dram_tb.vhdl
  12. 42
      core_flash_tb.vhdl
  13. 42
      core_tb.vhdl
  14. 136
      countbits.vhdl
  15. 118
      countbits_tb.vhdl
  16. 60
      countzero.vhdl
  17. 114
      countzero_tb.vhdl
  18. 20
      cr_file.vhdl
  19. 86
      cr_hazard.vhdl
  20. 466
      dcache.vhdl
  21. 82
      dcache_tb.vhdl
  22. 812
      decode1.vhdl
  23. 282
      decode2.vhdl
  24. 15
      decode_types.vhdl
  25. 6
      divider.vhdl
  26. 887
      divider_tb.vhdl
  27. 298
      dmi_dtm_ecp5.vhdl
  28. 398
      dmi_dtm_tb.vhdl
  29. 251
      dmi_dtm_xilinx.vhdl
  30. 57
      dram_tb.vhdl
  31. 1350
      execute1.vhdl
  32. 146
      fetch1.vhdl
  33. 30
      foreign_random.vhdl
  34. 139
      fpga/arty_a7.xdc
  35. 193
      fpga/clk_gen_ecp5.vhd
  36. 100
      fpga/clk_gen_mcmm.vhd
  37. 164
      fpga/clk_gen_plle2.vhd
  38. 2
      fpga/cmod_a7-35.xdc
  39. 4
      fpga/genesys2.xdc
  40. 54
      fpga/main_bram.vhdl
  41. 107
      fpga/nexys-video.xdc
  42. 2
      fpga/nexys_a7.xdc
  43. 12
      fpga/top-acorn-cle-215.vhdl
  44. 254
      fpga/top-arty.vhdl
  45. 6
      fpga/top-generic.vhdl
  46. 12
      fpga/top-genesys2.vhdl
  47. 324
      fpga/top-nexys-video.vhdl
  48. 512
      fpga/top-orangecrab0.2.vhdl
  49. 587
      fpga/top-wukong-v2.vhdl
  50. 487
      fpga/wukong-v2.xdc
  51. 71
      fpu.vhdl
  52. 99
      gpio.vhdl
  53. 107
      gpr_hazard.vhdl
  54. 18
      hello_world/head.S
  55. BIN
      hello_world/hello_world.bin
  56. BIN
      hello_world/hello_world.elf
  57. 292
      hello_world/hello_world.hex
  58. 24
      hello_world/powerpc.lds
  59. 48
      helpers.vhdl
  60. 154
      icache.vhdl
  61. 39
      icache_tb.vhdl
  62. 2
      include/microwatt_soc.h
  63. 6
      insn_helpers.vhdl
  64. 53
      litedram/extras/litedram-wrapper-l2.vhdl
  65. 4
      litedram/extras/sim_litedram.vhdl
  66. 9
      litedram/gen-src/acorn-cle-215.yml
  67. 9
      litedram/gen-src/arty.yml
  68. 2
      litedram/gen-src/dram-init-mem.vhdl
  69. 72
      litedram/gen-src/generate.py
  70. 16
      litedram/gen-src/genesys2.yml
  71. 9
      litedram/gen-src/nexys-video.yml
  72. 39
      litedram/gen-src/orangecrab-85-0.2.yml
  73. 2
      litedram/gen-src/sdram_init/Makefile
  74. 6
      litedram/gen-src/sdram_init/main.c
  75. 10
      litedram/gen-src/sim.yml
  76. 37
      litedram/gen-src/wukong-v2.yml
  77. 2
      litedram/generated/acorn-cle-215/litedram-initmem.vhdl
  78. 2318
      litedram/generated/acorn-cle-215/litedram_core.init
  79. 19311
      litedram/generated/acorn-cle-215/litedram_core.v
  80. 2
      litedram/generated/arty/litedram-initmem.vhdl
  81. 2318
      litedram/generated/arty/litedram_core.init
  82. 19327
      litedram/generated/arty/litedram_core.v
  83. 2
      litedram/generated/genesys2/litedram-initmem.vhdl
  84. 3000
      litedram/generated/genesys2/litedram_core.init
  85. 23775
      litedram/generated/genesys2/litedram_core.v
  86. 2
      litedram/generated/nexys-video/litedram-initmem.vhdl
  87. 2318
      litedram/generated/nexys-video/litedram_core.init
  88. 19731
      litedram/generated/nexys-video/litedram_core.v
  89. 123
      litedram/generated/orangecrab-85-0.2/litedram-initmem.vhdl
  90. 1955
      litedram/generated/orangecrab-85-0.2/litedram_core.init
  91. 13190
      litedram/generated/orangecrab-85-0.2/litedram_core.v
  92. 2
      litedram/generated/sim/litedram-initmem.vhdl
  93. 1687
      litedram/generated/sim/litedram_core.init
  94. 14771
      litedram/generated/sim/litedram_core.v
  95. 123
      litedram/generated/wukong-v2/litedram-initmem.vhdl
  96. 1986
      litedram/generated/wukong-v2/litedram_core.init
  97. 15666
      litedram/generated/wukong-v2/litedram_core.v
  98. 3
      liteeth/gen-src/arty.yml
  99. 2
      liteeth/gen-src/generate.sh
  100. 16
      liteeth/gen-src/nexys-video.yml
  101. Some files were not shown because too many files have changed in this diff Show More

36
.github/workflows/test.yml

@ -5,12 +5,19 @@ on: @@ -5,12 +5,19 @@ on:
pull_request:
schedule:
- cron: '0 0 * * 5'
workflow_dispatch:

jobs:

build:
runs-on: ubuntu-latest
container: ghdl/vunit:llvm
strategy:
fail-fast: false
matrix:
backend:
- llvm
- gcc
container: ghdl/vunit:${{ matrix.backend }}
steps:
- uses: actions/checkout@v2
- run: make GNATMAKE='gnatmake -j'$(nproc)
@ -33,7 +40,6 @@ jobs: @@ -33,7 +40,6 @@ jobs:
max-parallel: 3
matrix:
task: [
"tests_unit",
"tests_console",
"{1..99}",
"{100..199}",
@ -52,16 +58,24 @@ jobs: @@ -52,16 +58,24 @@ jobs:
- uses: actions/checkout@v2
- run: bash -c "make -j$(nproc) ${{ matrix.task }}"

VUnit:
needs: [build]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: docker://ghdl/vunit:llvm
with:
args: python3 ./run.py -p10

symbiflow:
strategy:
fail-fast: false
max-parallel: 2
matrix:
task: [ ECP5-EVN, ORANGE-CRAB ]
task: [ ECP5-EVN, ORANGE-CRAB, ORANGE-CRAB-0.21 ]
runs-on: ubuntu-latest
env:
DOCKER: 1
SYNTH_ECP5_FLAGS: -noflatten
FPGA_TARGET: ${{matrix.task}}
steps:
- uses: actions/checkout@v2
@ -79,3 +93,17 @@ jobs: @@ -79,3 +93,17 @@ jobs:
steps:
- uses: actions/checkout@v2
- run: make DOCKER=1 microwatt.v

verilator:
runs-on: ubuntu-latest
env:
DOCKER: 1
FPGA_TARGET: verilator
RAM_INIT_FILE: micropython/firmware.hex
MEMORY_SIZE: 524288
steps:
- uses: actions/checkout@v2
- run: |
sudo apt update
sudo apt install -y python3-pexpect
make -j$(nproc) test_micropython_verilator test_micropython_verilator_long

1
.gitignore vendored

@ -13,4 +13,5 @@ tests/*/*.hex @@ -13,4 +13,5 @@ tests/*/*.hex
tests/*/*.elf
TAGS
litedram/build/*
liteeth/build/*
obj_dir/*

150
Makefile

@ -1,12 +1,22 @@ @@ -1,12 +1,22 @@
GHDL ?= ghdl
GHDLFLAGS=--std=08 -frelaxed
GHDLFLAGS=--std=08
CFLAGS=-O3 -Wall
# Need to investigate why yosys is hitting verilator warnings, and eventually turn on -Wall
VERILATOR_FLAGS=-O3 -Wno-fatal -Wno-CASEOVERLAP -Wno-UNOPTFLAT #--trace
# It takes forever to build with optimisation, so disable by default
#VERILATOR_CFLAGS=-O3

GHDLSYNTH ?= ghdl.so
# some yosys builds have ghdl plugin built in, otherwise need "-m ghdl"
GHDLSYNTH ?= $(shell ($(YOSYS) -H | grep -q ghdl) || echo -m ghdl)
YOSYS ?= yosys
NEXTPNR ?= nextpnr-ecp5
ECPPACK ?= ecppack
ECPPROG ?= ecpprog
OPENOCD ?= openocd
VUNITRUN ?= python3 ./run.py
VERILATOR ?= verilator
DFUUTIL ?= dfu-util
DFUSUFFIX ?= dfu-suffix

# We need a version of GHDL built with either the LLVM or gcc backend.
# Fedora provides this, but other distros may not. Another option is to use
@ -29,37 +39,41 @@ PWD = $(shell pwd) @@ -29,37 +39,41 @@ PWD = $(shell pwd)
DOCKERARGS = run --rm -v $(PWD):/src:z -w /src
GHDL = $(DOCKERBIN) $(DOCKERARGS) ghdl/ghdl:buster-llvm-7 ghdl
CC = $(DOCKERBIN) $(DOCKERARGS) ghdl/ghdl:buster-llvm-7 gcc
GHDLSYNTH = ghdl
GHDLSYNTH = -m ghdl
YOSYS = $(DOCKERBIN) $(DOCKERARGS) hdlc/ghdl:yosys yosys
NEXTPNR = $(DOCKERBIN) $(DOCKERARGS) hdlc/nextpnr:ecp5 nextpnr-ecp5
ECPPACK = $(DOCKERBIN) $(DOCKERARGS) hdlc/prjtrellis ecppack
OPENOCD = $(DOCKERBIN) $(DOCKERARGS) --device /dev/bus/usb hdlc/prog openocd
VUNITRUN = $(DOCKERBIN) $(DOCKERARGS) ghdl/vunit:llvm python3 ./run.py
VERILATOR = $(DOCKERBIN) $(DOCKERARGS) verilator/verilator:latest
endif

all = core_tb icache_tb dcache_tb multiply_tb dmi_dtm_tb divider_tb \
rotator_tb countzero_tb wishbone_bram_tb soc_reset_tb
VUNITARGS += -p10

all = core_tb icache_tb dcache_tb dmi_dtm_tb \
wishbone_bram_tb soc_reset_tb

all: $(all)

core_files = decode_types.vhdl common.vhdl wishbone_types.vhdl fetch1.vhdl \
utils.vhdl plru.vhdl cache_ram.vhdl icache.vhdl \
decode1.vhdl helpers.vhdl insn_helpers.vhdl gpr_hazard.vhdl \
cr_hazard.vhdl control.vhdl decode2.vhdl register_file.vhdl \
decode1.vhdl helpers.vhdl insn_helpers.vhdl \
control.vhdl decode2.vhdl register_file.vhdl \
cr_file.vhdl crhelpers.vhdl ppc_fx_insns.vhdl rotator.vhdl \
logical.vhdl countzero.vhdl multiply.vhdl divider.vhdl execute1.vhdl \
logical.vhdl countbits.vhdl multiply.vhdl divider.vhdl execute1.vhdl \
loadstore1.vhdl mmu.vhdl dcache.vhdl writeback.vhdl core_debug.vhdl \
core.vhdl fpu.vhdl
core.vhdl fpu.vhdl pmu.vhdl

soc_files = $(core_files) wishbone_arbiter.vhdl wishbone_bram_wrapper.vhdl sync_fifo.vhdl \
wishbone_debug_master.vhdl xics.vhdl syscon.vhdl soc.vhdl \
soc_files = wishbone_arbiter.vhdl wishbone_bram_wrapper.vhdl sync_fifo.vhdl \
wishbone_debug_master.vhdl xics.vhdl syscon.vhdl gpio.vhdl soc.vhdl \
spi_rxtx.vhdl spi_flash_ctrl.vhdl

uart_files = $(wildcard uart16550/*.v)

soc_sim_files = $(soc_files) sim_console.vhdl sim_pp_uart.vhdl sim_bram_helpers.vhdl \
soc_sim_files = $(core_files) $(soc_files) sim_console.vhdl sim_pp_uart.vhdl sim_bram_helpers.vhdl \
sim_bram.vhdl sim_jtag_socket.vhdl sim_jtag.vhdl dmi_dtm_xilinx.vhdl \
sim_16550_uart.vhdl \
random.vhdl glibc_random.vhdl glibc_random_helpers.vhdl
foreign_random.vhdl glibc_random.vhdl glibc_random_helpers.vhdl

soc_sim_c_files = sim_vhpi_c.c sim_bram_helpers_c.c sim_console_c.c \
sim_jtag_socket_c.c
@ -76,7 +90,6 @@ $(unisim_lib): $(unisim_lib_files) @@ -76,7 +90,6 @@ $(unisim_lib): $(unisim_lib_files)
$(GHDL) -i --std=08 --work=unisim --workdir=$(unisim_dir) $^
GHDLFLAGS += -P$(unisim_dir)

core_tbs = multiply_tb divider_tb rotator_tb countzero_tb
soc_tbs = core_tb icache_tb dcache_tb dmi_dtm_tb wishbone_bram_tb
soc_flash_tbs = core_flash_tb
soc_dram_tbs = dram_tb core_dram_tb
@ -102,9 +115,6 @@ $(soc_flash_tbs): %: $(soc_sim_files) $(soc_sim_obj_files) $(unisim_lib) $(fmf_l @@ -102,9 +115,6 @@ $(soc_flash_tbs): %: $(soc_sim_files) $(soc_sim_obj_files) $(unisim_lib) $(fmf_l
$(soc_tbs): %: $(soc_sim_files) $(soc_sim_obj_files) $(unisim_lib) %.vhdl
$(GHDL) -c $(GHDLFLAGS) $(soc_sim_link) $(soc_sim_files) $@.vhdl -e $@

$(core_tbs): %: $(core_files) glibc_random.vhdl glibc_random_helpers.vhdl %.vhdl
$(GHDL) -c $(GHDLFLAGS) $(core_files) glibc_random.vhdl glibc_random_helpers.vhdl $@.vhdl -e $@

soc_reset_tb: fpga/soc_reset_tb.vhdl fpga/soc_reset.vhdl
$(GHDL) -c $(GHDLFLAGS) fpga/soc_reset_tb.vhdl fpga/soc_reset.vhdl -e $@

@ -115,10 +125,8 @@ $(soc_dram_tbs): @@ -115,10 +125,8 @@ $(soc_dram_tbs):
$(error "Verilator is required to make this target !")
else

VERILATOR_CFLAGS=-O3
VERILATOR_FLAGS=-O3
verilated_dram: litedram/generated/sim/litedram_core.v
verilator $(VERILATOR_FLAGS) -CFLAGS $(VERILATOR_CFLAGS) -Wno-fatal --cc $< --trace
verilator $(VERILATOR_FLAGS) -CFLAGS $(VERILATOR_CFLAGS) -Wno-fatal --cc $<
make -C obj_dir -f ../litedram/extras/sim_dram_verilate.mk VERILATOR_ROOT=$(VERILATOR_ROOT)

SIM_DRAM_CFLAGS = -I. -Iobj_dir -Ilitedram/generated/sim -I$(VERILATOR_ROOT)/include -I$(VERILATOR_ROOT)/include/vltstd
@ -126,7 +134,7 @@ SIM_DRAM_CFLAGS += -DVM_COVERAGE=0 -DVM_SC=0 -DVM_TRACE=1 -DVL_PRINTF=printf -fa @@ -126,7 +134,7 @@ SIM_DRAM_CFLAGS += -DVM_COVERAGE=0 -DVM_SC=0 -DVM_TRACE=1 -DVL_PRINTF=printf -fa
sim_litedram_c.o: litedram/extras/sim_litedram_c.cpp verilated_dram
$(CC) $(CPPFLAGS) $(SIM_DRAM_CFLAGS) $(CFLAGS) -c $< -o $@

soc_dram_files = $(soc_files) litedram/extras/litedram-wrapper-l2.vhdl litedram/generated/sim/litedram-initmem.vhdl
soc_dram_files = $(core_files) $(soc_files) litedram/extras/litedram-wrapper-l2.vhdl litedram/generated/sim/litedram-initmem.vhdl
soc_dram_sim_files = $(soc_sim_files) litedram/extras/sim_litedram.vhdl
soc_dram_sim_obj_files = $(soc_sim_obj_files) sim_litedram_c.o
dram_link_files=-Wl,obj_dir/Vlitedram_core__ALL.a -Wl,obj_dir/verilated.o -Wl,obj_dir/verilated_vcd_c.o -Wl,-lstdc++
@ -137,25 +145,54 @@ $(soc_dram_tbs): %: $(soc_dram_files) $(soc_dram_sim_files) $(soc_dram_sim_obj_f @@ -137,25 +145,54 @@ $(soc_dram_tbs): %: $(soc_dram_files) $(soc_dram_sim_files) $(soc_dram_sim_obj_f
endif

# Hello world
MEMORY_SIZE=8192
RAM_INIT_FILE=hello_world/hello_world.hex
MEMORY_SIZE ?=8192
RAM_INIT_FILE ?=hello_world/hello_world.hex

# Micropython
#MEMORY_SIZE=393216
#RAM_INIT_FILE=micropython/firmware.hex

FPGA_TARGET ?= ORANGE-CRAB
FPGA_TARGET ?= ORANGE-CRAB-0.21

# FIXME: icache RAMs aren't being inferrenced as block RAMs on ECP5
# with yosys, so make it smaller for now as a workaround.
ICACHE_NUM_LINES=4

clkgen=fpga/clk_gen_ecp5.vhd
toplevel=fpga/top-generic.vhdl
dmi_dtm=dmi_dtm_dummy.vhdl
LITEDRAM_GHDL_ARG=

# OrangeCrab with ECP85
# OrangeCrab with ECP85 (original v0.0 with UM5G-85 chip)
ifeq ($(FPGA_TARGET), ORANGE-CRAB)
RESET_LOW=true
CLK_INPUT=50000000
CLK_FREQUENCY=40000000
CLK_INPUT=48000000
CLK_FREQUENCY=48000000
LPF=constraints/orange-crab.lpf
PACKAGE=CSFBGA285
NEXTPNR_FLAGS=--um5g-85k --freq 40
NEXTPNR_FLAGS=--um5g-85k --freq 48
OPENOCD_JTAG_CONFIG=openocd/olimex-arm-usb-tiny-h.cfg
OPENOCD_DEVICE_CONFIG=openocd/LFE5UM5G-85F.cfg
ECP_FLASH_OFFSET=0x80000
endif

# OrangeCrab with ECP85 (v0.21)
ifeq ($(FPGA_TARGET), ORANGE-CRAB-0.21)
RESET_LOW=true
CLK_INPUT=48000000
CLK_FREQUENCY=48000000
LPF=constraints/orange-crab-0.2.lpf
PACKAGE=CSFBGA285
NEXTPNR_FLAGS=--85k --speed 8 --freq 48 --timing-allow-fail --ignore-loops
OPENOCD_JTAG_CONFIG=openocd/olimex-arm-usb-tiny-h.cfg
OPENOCD_DEVICE_CONFIG=openocd/LFE5U-85F.cfg
DFU_VENDOR=1209
DFU_PRODUCT=5af0
ECP_FLASH_OFFSET=0x80000
toplevel=fpga/top-orangecrab0.2.vhdl
litedram_target=orangecrab-85-0.2
soc_extra_v += litesdcard/generated/lattice/litesdcard_core.v
dmi_dtm=dmi_dtm_ecp5.vhdl
endif

# ECP5-EVN
@ -170,12 +207,17 @@ OPENOCD_JTAG_CONFIG=openocd/ecp5-evn.cfg @@ -170,12 +207,17 @@ OPENOCD_JTAG_CONFIG=openocd/ecp5-evn.cfg
OPENOCD_DEVICE_CONFIG=openocd/LFE5UM5G-85F.cfg
endif

ifneq ($(litedram_target),)
soc_extra_synth += litedram/extras/litedram-wrapper-l2.vhdl \
litedram/generated/$(litedram_target)/litedram-initmem.vhdl
soc_extra_v += litedram/generated/$(litedram_target)/litedram_core.v
LITEDRAM_GHDL_ARG=-gUSE_LITEDRAM=true
endif

GHDL_IMAGE_GENERICS=-gMEMORY_SIZE=$(MEMORY_SIZE) -gRAM_INIT_FILE=$(RAM_INIT_FILE) \
-gRESET_LOW=$(RESET_LOW) -gCLK_INPUT=$(CLK_INPUT) -gCLK_FREQUENCY=$(CLK_FREQUENCY)
-gRESET_LOW=$(RESET_LOW) -gCLK_INPUT=$(CLK_INPUT) -gCLK_FREQUENCY=$(CLK_FREQUENCY) -gICACHE_NUM_LINES=$(ICACHE_NUM_LINES) \
$(LITEDRAM_GHDL_ARG)

clkgen=fpga/clk_gen_ecp5.vhd
toplevel=fpga/top-generic.vhdl
dmi_dtm=dmi_dtm_dummy.vhdl

ifeq ($(FPGA_TARGET), verilator)
RESET_LOW=true
@ -184,22 +226,20 @@ CLK_FREQUENCY=50000000 @@ -184,22 +226,20 @@ CLK_FREQUENCY=50000000
clkgen=fpga/clk_gen_bypass.vhd
endif

fpga_files = $(core_files) $(soc_files) fpga/soc_reset.vhdl \
fpga_files = fpga/soc_reset.vhdl \
fpga/pp_fifo.vhd fpga/pp_soc_uart.vhd fpga/main_bram.vhdl \
nonrandom.vhdl

synth_files = $(core_files) $(soc_files) $(fpga_files) $(clkgen) $(toplevel) $(dmi_dtm)
synth_files = $(core_files) $(soc_files) $(soc_extra_synth) $(fpga_files) $(clkgen) $(toplevel) $(dmi_dtm)

microwatt.json: $(synth_files) $(RAM_INIT_FILE)
$(YOSYS) -m $(GHDLSYNTH) -p "ghdl --std=08 --no-formal $(GHDL_IMAGE_GENERICS) $(GHDL_TARGET_GENERICS) $(synth_files) -e toplevel; synth_ecp5 -json $@ $(SYNTH_ECP5_FLAGS)" $(uart_files)
$(YOSYS) $(GHDLSYNTH) -p "ghdl --std=08 --no-formal $(GHDL_IMAGE_GENERICS) $(synth_files) -e toplevel; read_verilog $(uart_files) $(soc_extra_v); synth_ecp5 -abc9 -nowidelut -json $@ $(SYNTH_ECP5_FLAGS)"

microwatt.v: $(synth_files) $(RAM_INIT_FILE)
$(YOSYS) -m $(GHDLSYNTH) -p "ghdl --std=08 --no-formal $(GHDL_IMAGE_GENERICS) $(GHDL_TARGET_GENERICS) $(synth_files) -e toplevel; write_verilog $@"
$(YOSYS) $(GHDLSYNTH) -p "ghdl --std=08 --no-formal $(GHDL_IMAGE_GENERICS) $(synth_files) -e toplevel; write_verilog $@"

# Need to investigate why yosys is hitting verilator warnings, and eventually turn on -Wall
microwatt-verilator: microwatt.v verilator/microwatt-verilator.cpp verilator/uart-verilator.c
verilator -O3 -CFLAGS "-DCLK_FREQUENCY=$(CLK_FREQUENCY)" --assert --cc microwatt.v --exe verilator/microwatt-verilator.cpp verilator/uart-verilator.c -o $@ -Iuart16550 -Wno-fatal -Wno-CASEOVERLAP -Wno-UNOPTFLAT #--trace
make -C obj_dir -f Vmicrowatt.mk
$(VERILATOR) $(VERILATOR_FLAGS) -CFLAGS "$(VERILATOR_CFLAGS) -DCLK_FREQUENCY=$(CLK_FREQUENCY)" -Iuart16550 --assert --cc --exe --build $^ -o $@ -top-module toplevel
@cp -f obj_dir/microwatt-verilator microwatt-verilator

microwatt_out.config: microwatt.json $(LPF)
@ -207,18 +247,36 @@ microwatt_out.config: microwatt.json $(LPF) @@ -207,18 +247,36 @@ microwatt_out.config: microwatt.json $(LPF)
mv -f $@.tmp $@

microwatt.bit: microwatt_out.config
$(ECPPACK) --svf microwatt.svf $< $@
$(ECPPACK) --compress --freq 38.8 --svf microwatt.svf $< $@

microwatt.svf: microwatt.bit

prog: microwatt.svf
$(OPENOCD) -f $(OPENOCD_JTAG_CONFIG) -f $(OPENOCD_DEVICE_CONFIG) -c "transport select jtag; init; svf $<; exit"

microwatt.dfu: microwatt.bit
cp $< $@.tmp
$(DFUSUFFIX) -v $(DFU_VENDOR) -p $(DFU_PRODUCT) -a $@.tmp
mv $@.tmp $@

dfuprog: microwatt.dfu
$(DFUUTIL) -a 0 -D $<

ecpprog: microwatt.bit
$(ECPPROG) -S $<

ecpflash: microwatt.bit
test -n "$(ECP_FLASH_OFFSET)" || (echo Error: No ECP_FLASH_OFFSET defined for target; exit 1)
$(ECPPROG) -o $(ECP_FLASH_OFFSET) $<

tests = $(sort $(patsubst tests/%.out,%,$(wildcard tests/*.out)))
tests_console = $(sort $(patsubst tests/%.console_out,%,$(wildcard tests/*.console_out)))

tests_console: $(tests_console)

check_vunit:
$(VUNITRUN) $(VUNITARGS)