1
0
mirror of https://github.com/antonblanchard/microwatt.git synced 2026-01-13 15:18:09 +00:00

14 Commits

Author SHA1 Message Date
Anton Blanchard
b57325ce29 Merge branch 'divider' of https://github.com/paulusmack/microwatt 2019-09-24 17:33:21 +10:00
Paul Mackerras
d5bc6c8824 Add a divider unit and a testbench for it
This adds a divider unit, connected to the core in much the same way
that the multiplier unit is connected.  The division algorithm is
very simple-minded, taking 64 clock cycles for any division (even
32-bit division instructions).

The decoding is simplified by making use of regularities in the
instruction encoding for div* and mod* instructions.  Instead of
having PPC_* encodings from the first-stage decoder for each of the
different div* and mod* instructions, we now just have PPC_DIV and
PPC_MOD, and the inputs to the divider that indicate what sort of
division operation to do are derived from instruction word bits.

Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
2019-09-23 14:31:53 +10:00
Benjamin Herrenschmidt
98f0994698 Add core debug module
This module adds some simple core controls:

  reset, stop, start, step

along with icache clear and reading the NIA and core
status bits

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org
2019-09-20 16:45:50 +10:00
Anton Blanchard
d813ffb748 Fix spurious outstanding assert
Check it in the sequential process, not the combinatorial one.

Signed-off-by: Anton Blanchard <anton@linux.ibm.com>
2019-09-15 18:59:24 +10:00
Anton Blanchard
80aa781454
Merge pull request #47 from antonblanchard/if-fix
Explicitly check against '1' in if statements
2019-09-12 09:46:22 +10:00
Anton Blanchard
b9e28598b4 Explicitly check against '1' in if statements
nvc doesn't like what I think is a VHDL 2008 construct. Lets just
check against '1' explicitly.

Signed-off-by: Anton Blanchard <anton@linux.ibm.com>
2019-09-12 09:19:31 +10:00
Anton Blanchard
1d00c75ecc Remove nia from loadstore and multiply
Neither unit needs the NIA, so remove it.

Signed-off-by: Anton Blanchard <anton@linux.ibm.com>
2019-09-11 21:42:37 +10:00
Anton Blanchard
a8f8c54b77 Move debug execute output into decode2
This covers all units, and we avoid double printing.

Signed-off-by: Anton Blanchard <anton@linux.ibm.com>
2019-09-11 13:23:45 +10:00
Anton Blanchard
92a7152370 Rework pipeline, add stall and flush signals
This adds stall and flush signals to the pipeline.

Signed-off-by: Anton Blanchard <anton@linux.ibm.com>
2019-09-11 13:23:45 +10:00
Anton Blanchard
a1ab1d3e56
Merge pull request #25 from antonblanchard/register_file_printing
Clean up register read debug output
2019-09-09 11:42:41 +10:00
Anton Blanchard
04eb9583e6 Clean up register read debug output
Right now we continually print all 3 possible GPRs an instruction
may be using. Add signals so we only print GPRs when they are
actually read. This should hopefully optimise away when synthesized.

Signed-off-by: Anton Blanchard <anton@linux.ibm.com>
2019-09-09 11:18:26 +10:00
Anton Blanchard
9fbaea6f08 Rework CR file and add forwarding
Handle the CR as a single field with per nibble enables. Forward any
writes in the same cycle.

If this proves to be an issue for timing, we may want to revisit
this in the future. For now, it keeps things simple.

Signed-off-by: Anton Blanchard <anton@linux.ibm.com>
2019-09-09 10:18:10 +10:00
Anton Blanchard
5e140298a5 Rework decode2
The decode2 stage was spaghetti code and needed cleaning up.
Create a series of functions to pull fields from a ppc instruction
and also a series of helpers to extract values for the execution
units.

As suggested by Paul, we should pass all signals to the execution
units and only set the valid signal conditionally, which should
use less resources.

Signed-off-by: Anton Blanchard <anton@linux.ibm.com>
2019-09-03 16:47:54 +10:00
Anton Blanchard
5a29cb4699 Initial import of microwatt
Signed-off-by: Anton Blanchard <anton@linux.ibm.com>
2019-08-22 16:46:13 +10:00