Commit Graph

877 Commits (9a6a7e9fe5711b0d3fd0b62d98b3f80b9bf6394e)
 

Author SHA1 Message Date
Benjamin Herrenschmidt b8df0647fd mw_debug: Fix memory overflow with "sim" backend
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
5 years ago
Anton Blanchard 84ab28b3d2
Merge pull request #178 from antonblanchard/intercon
Interconnect timing improvements from Ben
5 years ago
Anton Blanchard 4c1a73131b
Merge pull request #184 from antonblanchard/verific
Delete old verific script
5 years ago
Michael Neuling ad1c8e7e14 Delete bit rotted verific script
We can use ghdl-synth and fusesoc now, so verific is a dead path which
has bit rotted.

Signed-off-by: Michael Neuling <mikey@neuling.org>
5 years ago
Shawn Anastasio 8b161c6dc6 Add a new misc test suite with addpcis tests
The two tests obtain NIA with bl+mflr+addi and then compare it
against addpcis with the minimum and maximum immediate operand values.

They were also tested on a real POWER9 system (in userspace) for good
measure.

Signed-off-by: Shawn Anastasio <shawn@anastas.io>
5 years ago
Shawn Anastasio e606772aeb Implement the addpcis instruction
This commit adds support for the addpcis instruction from ISA 3.0.

A new input_reg_b_t type, CONST_DX_HI, was added to support the
shifted immediate value used in DX-Form instructions.

Signed-off-by: Shawn Anastasio <shawn@anastas.io>
5 years ago
Benjamin Herrenschmidt 12f36b4a35 litedram: Split the init memory from the main wrapper
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
5 years ago
Benjamin Herrenschmidt f86fb74bfe irq: Simplify xics->core irq input
Use a simple wire. common.vhdl types are better kept for things
local to the core. We can add more wires later if we need to for
HV irqs etc...

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
5 years ago
Benjamin Herrenschmidt 573b6b4bc4 soc: Rework interconnect
This changes the SoC interconnect such that the main 64-bit wishbone out
of the processor is first split between only 3 slaves (BRAM, DRAM and a
general "IO" bus) instead of all the slaves in the SoC.

The IO bus leg is then latched and down-converted to 32 bits data width,
before going through a second address decoder for the various IO devices.

This significantly reduces routing and timing pressure on the main bus,
allowing to get rid of frequent timing violations when synthetizing on
small'ish FPGAs such as the Artix-7 35T found on the original Arty board.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
5 years ago
Benjamin Herrenschmidt 8d64090a68 sw: Add full memory map to .h and use it for litedram .lds
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
5 years ago
Anton Blanchard bdb428a40b
Merge pull request #181 from antonblanchard/Makefile-rework-2
Pass clock frequency to UART sim wrapper
5 years ago
Anton Blanchard 04c56a0c52 Pass clock frequency to UART sim wrapper
The UART sim wrapper is currently hard wired to 50 MHz.

Signed-off-by: Anton Blanchard <anton@linux.ibm.com>
5 years ago
Anton Blanchard cb25167220
Merge pull request #180 from antonblanchard/Makefile-rework
Makefile rework
5 years ago
Anton Blanchard 7b14819dbb A little less shouting in the Makefile
Signed-off-by: Anton Blanchard <anton@linux.ibm.com>
5 years ago
Anton Blanchard 01da807476 Fix the simulated DMI
Signed-off-by: Anton Blanchard <anton@linux.ibm.com>
5 years ago
Anton Blanchard ab86b58d95 Exit cleanly from testbench on success
Signed-off-by: Anton Blanchard <anton@linux.ibm.com>
5 years ago
Anton Blanchard a9e7194de5 Merge Makefile and Makefile.synth
We still need to a way to our FPGA target on the command line, but this
at least gets us down to a common Makefile.

Signed-off-by: Anton Blanchard <anton@linux.ibm.com>
5 years ago
Anton Blanchard 6326efaca4 Add Makefile command line variables to enable docker and podman
Instead of having to edit the Makefile, we can now do:

make DOCKER=1
make PODMAN=1

Signed-off-by: Anton Blanchard <anton@linux.ibm.com>
5 years ago
Anton Blanchard 224e7734a8 Rework Makefile
Instead of building each file one by one (and having to track all
the dependencies manually), use the ghdl -c command that does
analysis and elaboration in one go.

Signed-off-by: Anton Blanchard <anton@linux.ibm.com>
5 years ago
Anton Blanchard b82d07c8d5
Merge pull request #179 from antonblanchard/yosys-verilator
Add yosys/verilator support
5 years ago
Anton Blanchard 8c028f26f1 Improve make clean
Signed-off-by: Anton Blanchard <anton@linux.ibm.com>
5 years ago
Anton Blanchard 3e8a6a8fc2 Add yosys/verilator support
Add a microwatt-verilator target that simulates the
ghdl -> yosys -> verilog -> verilator path. A good test of
ghdl/yosys synthesis.

Because the everything is run through synthesis, the instruction
image is baked into the build via the RAM_INIT_FILE generic.

Signed-off-by: Anton Blanchard <anton@linux.ibm.com>
5 years ago
Anton Blanchard 354e0fbfea
Merge pull request #171 from shenki/mw-debug-features
mw debug features
5 years ago
Anton Blanchard 6692f0db4f
Merge pull request #173 from Jbalkind/core-vcs-syntax
Changing use of others in core files to satisfy VCS
5 years ago
Joel Stanley 5860c2d1b6 mw_debug: Add README
This describes how to build the tool on Fedora, and on Debian which lacks a packaged
liburjtag as of mid 2020.

Signed-off-by: Joel Stanley <joel@jms.id.au>
5 years ago
Joel Stanley 2bf5bf4bac mw_debug: Add usage text
Signed-off-by: Joel Stanley <joel@jms.id.au>
5 years ago
Joel Stanley fa90f0dbb1 mw_debug: Add CFLAGS and fix warnings
CFLAGS was defined but not used anywhere. This adds them to the compile
line, and fixes the warnings (and errors!) that result.

Signed-off-by: Joel Stanley <joel@jms.id.au>
5 years ago
Anton Blanchard 6d36ef93d9
Merge pull request #177 from antonblanchard/litedram
LiteDRAM fixes from Ben
5 years ago
Anton Blanchard 4e78b8078e
Merge branch 'master' into litedram 5 years ago
Anton Blanchard e9251544f4
Merge pull request #176 from antonblanchard/console-improv
Console improvements from Ben
5 years ago
Anton Blanchard 03369a137c
Merge pull request #175 from antonblanchard/yosys-fixes-2
Fix yosys build after MMU merge
5 years ago
Jonathan Balkind cc532dd065 Changes for compilation with VCS:
- Changing use of others in core files to satisfy VCS
- Adding workaround for VCS subtype constraint inconsistencies in common.vhdl

Signed-off-by: Jonathan Balkind <jbalkind@princeton.edu>
5 years ago
Anton Blanchard 2aae3bf7a4 Fix yosys build after MMU merge
Signed-off-by: Anton Blanchard <anton@linux.ibm.com>
5 years ago
Anton Blanchard 9287e80711
Merge pull request #174 from antonblanchard/yosys-fixes
Some yosys fixes
5 years ago
Anton Blanchard f96d179f66 Some yosys fixes
This gets the yosys build further along, but I'm now chasing what looks
like a yosys bug.

Signed-off-by: Anton Blanchard <anton@linux.ibm.com>
5 years ago
Anton Blanchard 7c4dab7eb0
Merge pull request #169 from paulusmack/mmu
Add radix MMU with dTLB and iTLB
5 years ago
Benjamin Herrenschmidt 6efb31c924 litedram: Regenerate
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
5 years ago
Benjamin Herrenschmidt acbdd396a5 soc/core: Add reset latches
This adds one-cycle latches to the various resets out of the soc and
into the various core modules. It *seems* to help vivado P&R a bit
and has shown to avoid timing violations under some circumstances.

Interestingly those resets never seem to appear in the bad timing
path. It looks like those long resets simply impose placement
constraints that Vivado satisfies at the expense of timing elsewhere.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
5 years ago
Benjamin Herrenschmidt 7560e8f2ff arty/nexys: Rework reset with litedram
When using litedram, request a much longer PLL reset. This seems to
help get rid of all the grabled output after config.

Also use the clean system_rst out of litedram as our source of reset
for the rest of the SoC (it is synchronized with system_clk and takes
pll_locked into account already)
5 years ago
Benjamin Herrenschmidt 3b603402d2 soc_reset: Use counters, add synchronizers
In some cases we need to keep the reset held for much longer,
so use counters rather than shift registers.

Additionally, some signals such as ext_rst and pll_locked
or signals going from the ext_clk domain to the pll_clk
domain need to be treated as async, and testing them without
synchronizers is asking for trouble.

Finally, make the external reset also reset the PLL.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
5 years ago
Benjamin Herrenschmidt 30fd9aa298 litedram: Forward system reset signal
The wrapper wouldn't forward it. Make it do so

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
5 years ago
Benjamin Herrenschmidt c0f537b845 litedram: Remove init delays
The clocks / resets are now stable

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
5 years ago
Benjamin Herrenschmidt c19b5b8cc7 litedram: Update to new LiteX/LiteDRAM version
Things have changed a bit in upstream LiteX. LiteDRAM now exposes a
wishbone for the CSRs for example.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
5 years ago
Paul Mackerras eca0fb5bf1 dcache: Fix bug in store hit after dcbz case
This fixes a bug where a store that hits in the dcache immediately
following a dcbz has its write to the cache RAM suppressed (but not
its write to memory).  If a load to the same location comes along
before the cache line gets replaced, the load will return incorrect
data.

Fixes: 4db1676ef8 ("dcache: Don't assert on dcbz cache hit")
Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
5 years ago
Benjamin Herrenschmidt 13e84b0bbb pp_soc_uart: Fix rx synchronizers and ensure stable tx init state
The rx synchronizers were ... non existent. Someone forgot to add
a if rising_edge(clk) to the process.

For tx, ensure that we have a default value so that TX stays high
from TPGA configuration to the reset being sampled on the first clock
cycle.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
5 years ago
Benjamin Herrenschmidt bd42580a42 pp_fifo: Fix full fifo losing all data on simultaneous push & pop
The pp_fifo decides whether top = bottom means empty or full based
on whether the previous operation was a push or a pop.

If the fifo performs both in one cycle, it sets the previous op to
pop. That means that a full fifo being added a character and removed
one at the same time becomes empty.

Instead, just leave the previous op alone. If the fifo was empty, it
remains so, if it was full ditto.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
5 years ago
Benjamin Herrenschmidt 803ee9ef35 Makefile: Improve clean a bit
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
5 years ago
Benjamin Herrenschmidt edbbf9a125 console: Remove putstr()
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
5 years ago
Benjamin Herrenschmidt 7bc118c7db console: Move console files
console.c goes to a new lib/ where we'll store other general utilities
and console.h goes to include/

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
5 years ago
Benjamin Herrenschmidt a87b86e54f console: Replace putstr with puts
It makes things a bit more standard and a bit nicer to read
without all those strlen(). Also console.c takes care of adding
the carriage returns before the linefeeds.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
5 years ago