1
0
mirror of https://github.com/antonblanchard/microwatt.git synced 2026-01-31 05:42:15 +00:00
Commit Graph

985 Commits

Author SHA1 Message Date
Anton Blanchard
efb387b0d2 makefile: Add some verilator micropython tests
These are the same micropython tests we use against the ghdl
simulation.

Signed-off-by: Anton Blanchard <anton@linux.ibm.com>
2021-08-14 19:36:29 +10:00
Anton Blanchard
8acd5a5607 verilator: Specify top level module
While verilator finds the correct top level module with the current
setup, if we start adding simulation models it can get confused.

Explicitly specify the top level module.

Signed-off-by: Anton Blanchard <anton@linux.ibm.com>
2021-08-14 19:35:58 +10:00
Anton Blanchard
7e2de602ee makefile: Simplify microwatt-verilator target, add Docker image
Recent versions of verilator support the --build option, allowing
us to remove a step.

Also add a Docker image for verilator.

Signed-off-by: Anton Blanchard <anton@linux.ibm.com>
2021-08-14 19:35:53 +10:00
Paul Mackerras
8cdb00652b Merge pull request #316 from antonblanchard/verilator-fix
Rename 'do' signal to avoid verilator System Verilog warning
2021-08-14 10:18:42 +10:00
Paul Mackerras
71af8016da Merge pull request #317 from antonblanchard/gpio-fix
gpio: Add HAS_GPIO to avoid verilator build errors
2021-08-14 10:18:12 +10:00
Anton Blanchard
591e96d1a2 gpio: Add HAS_GPIO to avoid verilator build errors
The verilator build fails with warnings and errors, because NGPIO
is 0 and we do things like:

        gpio_out : out std_ulogic_vector(NGPIO - 1 downto 0);

Set NGPIO to something reasonable (eg 32) and add HAS_GPIO to avoid
building the macro entirely if it isn't in use.

Signed-off-by: Anton Blanchard <anton@linux.ibm.com>
2021-08-13 14:51:15 +10:00
Anton Blanchard
bc0f7cf236 Rename 'do' signal to avoid verilator System Verilog warning
Experimenting with using ghdl to do VHDL to Verilog conversion (instead
of ghdl+yosys), verilator complains that a signal is a SystemVerilog
keyword:

%Error: microwatt.v:15013:18: Unexpected 'do': 'do' is a SystemVerilog keyword misused as an identifier.
        ... Suggest modify the Verilog-2001 code to avoid SV keywords, or use `begin_keywords or --language.

We could probably make this go away by disabling SystemVerilog, but
it's easy to rename the signal in question. Rename di at the same
time.

Signed-off-by: Anton Blanchard <anton@linux.ibm.com>
2021-08-13 13:52:51 +10:00
Michael Neuling
2bd00f5119 Merge pull request #315 from paulusmack/pmu
Add basic PMU implementation
2021-08-12 08:24:05 +10:00
Paul Mackerras
1896e5f803 Merge pull request #314 from antonblanchard/yosys-go-fast-bits
Reduce Yosys ECP5 cell usage by 30% with -abc9 -nowidelut
2021-08-11 16:26:29 +10:00
Michael Neuling
400e481ffa Merge pull request #313 from paulusmack/fixes
Fix bug causing FP unavailable interrupts to be missed
2021-08-11 16:25:35 +10:00
Paul Mackerras
a7873b45f7 core: Add a basic performance monitor unit (PMU) implementation
This is the start of an implementation of a PMU according to PowerISA
v3.0B.  Things not implemented yet include most architected events,
the BHRB, event-based branches, thresholding, MMCR0[TBCC] field, etc.

Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
2021-08-11 16:05:47 +10:00
Anton Blanchard
6254bb5ee9 Reduce Yosys ECP5 cell usage by 30% with -abc9 -nowidelut
We've been investigating why the barrel rotator uses an enormous
number of cells on the yosys ECP5 target. Eventually it was narrowed
down to the -abc9 -nowidelut options, which see the cell count go from
4985 cells to 841 cells.

Using the same options on an Orange Crab build reduces the cell count
from 50864 to 36085. The main differences:

     LUT4                        31040 -> 25270
     PFUMX                        6956 ->     0
     L6MUX21                      1746 ->     0
     CCU2C                        2066 ->  1759

Signed-off-by: Anton Blanchard <anton@linux.ibm.com>
2021-08-11 14:49:30 +10:00
Michael Neuling
aa4e4e77c4 Merge pull request #311 from antonblanchard/litesdcard-nexys-video
Update litesdcard from upstream and add Nexys Video support
2021-08-11 09:48:07 +10:00
Michael Neuling
65c131e89f Merge pull request #312 from shenki/sdcard-soc-features
litedram: Add sdcard to soc features
2021-08-11 09:33:36 +10:00
Paul Mackerras
f40842d9b2 tests/fpu: Test FPU unavailable interrupt following a load
This adds a load before a floating-point load which should generate a
floating-point unavailable interrupt, to test for the bug where
unavailability interrupts can get dropped while loadstore1 is
executing instructions.

Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
2021-08-10 20:13:26 +10:00
Joel Stanley
bc3995804f litedram: Add sdcard to soc features
Signed-off-by: Joel Stanley <joel@jms.id.au>
2021-08-10 18:49:29 +09:30
Paul Mackerras
64e3ce7134 execute1: Handle interrupts during sequences of load/store operations
At present the logic prevents any interrupts from being handled while
there is a load/store instruction (one that has unit=LDST) being
executed.  However, load/store instructions can still get sent to
loadstore1.  Thus an instruction which should generate an interrupt
such as a floating-point unavailable interrupt will instead get
executed.

To fix this, when we detect that an interrupt should be generated but
loadstore1 is still executing a previous instruction, we don't execute
any new instructions, and set a new r.intr_pending flag.  That results
in busy_out being asserted (meaning that no further instructions will
come in from decode2).  When loadstore1 has finished the instructions
it has, the interrupt gets sent to writeback.  If one of the
instructions in loadstore1 generates an interrupt in the meantime, the
l_in.interrupt signal gets asserted and that clears r.intr_pending, so
the interrupt we detected gets discarded.

Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
2021-08-10 19:18:45 +10:00
Anton Blanchard
7cfbcd5514 litesdcard: Add Nexys Video support
This board has a reset line that needs to be held low to power up the
SD card hardware.

Signed-off-by: Anton Blanchard <anton@linux.ibm.com>
2021-08-10 14:08:22 +10:00
Anton Blanchard
9caaa3fc46 litesdcard: Use vendor not board type
litesdcard provides a macro per vendor (eg xilinx, lattice) and not per
board, so modify the fusesoc generator to take a vendor. This will make
it easier to add litesdcard to more boards.

Signed-off-by: Anton Blanchard <anton@linux.ibm.com>
2021-08-10 14:08:22 +10:00
Paul Mackerras
c198b2b82e Merge pull request #310 from antonblanchard/liteeth-update-2
Update liteeth from upstream and add Nexys Video support
2021-08-10 14:04:55 +10:00
Anton Blanchard
34e10cc52c liteeth: Regenerate from upstream litex
Unfortunately the CSR layout has shifted on upstream litex, so this
is built with the following litex patch backed out:

aad56a047a33 ("integration/soc: Use CSR automatic allocation.")

Signed-off-by: Anton Blanchard <anton@linux.ibm.com>
2021-08-10 11:49:36 +10:00
Anton Blanchard
12efb51bcc liteeth: Update yaml config
csr_data_width is no longer required. Add ntxslots and nrxslots
parameters but set them to the default value.

Signed-off-by: Anton Blanchard <anton@linux.ibm.com>
2021-08-09 21:21:08 +10:00
Anton Blanchard
458dfe01a6 Add liteeth support to Nexys Video
Signed-off-by: Anton Blanchard <anton@linux.ibm.com>
2021-08-09 21:21:04 +10:00
Michael Neuling
cf6df4f17f Merge pull request #307 from antonblanchard/litedram-update
Updating to latest upstream litedram and some cleanups to associated scripts
2021-08-09 15:42:05 +10:00
Michael Neuling
69a1440204 Merge pull request #309 from antonblanchard/clk-cleanup
Small cleanups to clock definitions
2021-08-09 15:31:09 +10:00
Michael Neuling
b885ee7ed1 Merge pull request #308 from antonblanchard/small-fixes
Fix some whitespace issues
2021-08-09 14:25:06 +10:00
Anton Blanchard
75e06a1e30 Remove -add from xdc files
Signed-off-by: Anton Blanchard <anton@linux.ibm.com>
2021-08-09 13:30:26 +10:00
Anton Blanchard
187199c489 Remove -waveform from xdc files
A 50% duty cycle is the default, so no need to use -waveform.

Signed-off-by: Anton Blanchard <anton@linux.ibm.com>
2021-08-09 13:30:26 +10:00
Anton Blanchard
7994b98404 Fix some whitespace issues
Signed-off-by: Anton Blanchard <anton@linux.ibm.com>
2021-08-09 11:57:00 +10:00
Anton Blanchard
46cde3bb23 Merge pull request #305 from mikey/noflatten
ci: Remove noflatten to reduce size of ECP5 builds
2021-08-09 11:28:49 +10:00
Anton Blanchard
780d6c754c litedram: Regenerate from upstream litex
Signed-off-by: Anton Blanchard <anton@linux.ibm.com>
2021-08-09 10:54:35 +10:00
Anton Blanchard
07f2edc415 litedram: sdrinit() is now sdram_init()
Signed-off-by: Anton Blanchard <anton@linux.ibm.com>
2021-08-09 10:53:51 +10:00
Anton Blanchard
346686feb8 litedram: Fix compiler warning
define MAIN_RAM_BASE and MAIN_RAM_SIZE as unsigned long

Signed-off-by: Anton Blanchard <anton@linux.ibm.com>
2021-08-09 10:52:33 +10:00
Anton Blanchard
ac546a3024 litedram: Update yaml files
Update the litedram yaml files based on latest upstream.

Signed-off-by: Anton Blanchard <anton@linux.ibm.com>
2021-08-09 10:52:26 +10:00
Anton Blanchard
6034a9e31f litedram: simplify generate.py
We can call litedram_gen instead of doing the work ourselves.

Signed-off-by: Anton Blanchard <anton@linux.ibm.com>
2021-08-09 10:52:22 +10:00
Anton Blanchard
3275304a7f litedram: Remove variables.mak
Instead of creating variables.mak, just pass the variables in on
the make command line.

Signed-off-by: Anton Blanchard <anton@linux.ibm.com>
2021-08-09 10:52:17 +10:00
Michael Neuling
d6efbb327f ci: Remove noflatten to reduce size of ECP5 builds
This option was added in the commit but is no longer needed for github
CI to work.

    commit ef0dcf3bc6
    Author: Michael Neuling <mikey@neuling.org>
    Date:   Thu Jul 2 14:36:14 2020 +1000
    Add SYNTH_ECP5_FLAGS option for building

Removing noflatten has the added advantage that it gets our builds
from 75% down to 59% usage on ECP5 85K.

Signed-off-by: Michael Neuling <mikey@neuling.org>
2021-08-04 17:01:45 +10:00
Anton Blanchard
0199ff8ca8 Merge pull request #299 from mikey/vunit-make
makefile: Add check_vunit
2021-08-04 13:59:22 +10:00
Michael Neuling
25ab1053e9 Merge pull request #304 from umarcor/ci-backends
ci: test 'build' with LLVM and GCC backends
2021-08-04 09:57:35 +10:00
umarcor
de41dfc703 ci: test 'build' with LLVM and GCC backends
Signed-off-by: umarcor <unai.martinezcorral@ehu.eus>
2021-08-03 16:13:20 +02:00
Michael Neuling
0cd826d190 Merge pull request #301 from umarcor/vunit-cleanup
VUnit cleanup
2021-08-02 14:22:11 +10:00
Michael Neuling
bf76261979 makefile: Add check_vunit
Allow newly added vuint run script to be run via make. Also integrate
with DOCKER/PODMAN=1.

Signed-off-by: Michael Neuling <mikey@neuling.org>
2021-08-02 13:42:12 +10:00
umarcor
178c2a7da3 VUnit: style
Signed-off-by: umarcor <unai.martinezcorral@ehu.eus>
2021-07-31 14:09:44 +02:00
umarcor
2031c6d2d2 VUnit: use Path.glob instead of glob.glob
Signed-off-by: umarcor <unai.martinezcorral@ehu.eus>
2021-07-31 14:09:44 +02:00
umarcor
7571416f81 ci: add 'workflow_dispatch'
Signed-off-by: umarcor <unai.martinezcorral@ehu.eus>
2021-07-31 14:09:44 +02:00
umarcor
faf8309629 ci: in job 'VUnit' use a container step instead of a container job
Signed-off-by: umarcor <unai.martinezcorral@ehu.eus>
2021-07-31 14:09:44 +02:00
Michael Neuling
d7458d5beb Reduce the size of icache to help yosys ECP5 builds (#303)
The icache RAM is currently LUT ram not block ram. This massively
bloats the icache size. We think this is due to yosys not inferencing
the RAM correctly but that's yet to be confirmed.

Work around this for now by reducing the default size of the icache
RAM for the ECP5 builds.

On the ECP5 85K builts, this gets us from 95% down to 76% and helps
our CI to pass.

Signed-off-by: Michael Neuling <mikey@neuling.org>
2021-07-31 11:18:39 +10:00
Michael Neuling
f9654428ff Merge pull request #296 from LarsAsplund/logging-checking
Replaced VHDL assert and report with VUnit checking and logging
2021-06-21 17:58:34 +10:00
Michael Neuling
9e3c756234 Merge pull request #298 from paulusmack/master
MMU: Implement a vestigial partition table
2021-06-21 11:51:13 +10:00
Michael Neuling
ff7421c54e Merge pull request #295 from LarsAsplund/master
Run VHDL tests with VUnit
2021-06-21 11:25:40 +10:00