soc.git
3 years agorename and document fields in shift_rot proof
Luke Kenneth Casson Leighton [Wed, 19 Aug 2020 22:03:54 +0000 (23:03 +0100)]
rename and document fields in shift_rot proof

3 years agocomments in dcache
Luke Kenneth Casson Leighton [Wed, 19 Aug 2020 18:58:12 +0000 (19:58 +0100)]
comments in dcache

3 years agomore subtle interactions between wishbone bus when there are delays,
Luke Kenneth Casson Leighton [Wed, 19 Aug 2020 18:02:30 +0000 (19:02 +0100)]
more subtle interactions between wishbone bus when there are delays,
LD/ST CompUnit and PortInterface

3 years agobit of a reorg of mul proof, tracking down missing
Luke Kenneth Casson Leighton [Wed, 19 Aug 2020 06:24:58 +0000 (07:24 +0100)]
bit of a reorg of mul proof, tracking down missing
Assume op.is_32bit == 0 for OP_MUL_H32

3 years agomove long mul tests to separate unit test
Luke Kenneth Casson Leighton [Wed, 19 Aug 2020 06:24:00 +0000 (07:24 +0100)]
move long mul tests to separate unit test

3 years agouse "Mask" class which is more gate-efficient than (1<<x)-1
Luke Kenneth Casson Leighton [Wed, 19 Aug 2020 04:45:21 +0000 (05:45 +0100)]
use "Mask" class which is more gate-efficient than (1<<x)-1

3 years agoWIP: OP_MUL proofs started.
Samuel A. Falvo II [Wed, 19 Aug 2020 04:12:19 +0000 (21:12 -0700)]
WIP: OP_MUL proofs started.

I am out of my league.  Cannot figure out how to make proof pass.
Committing latest incarnation of proof code.

3 years agoset up StageChain of 3 mul stages
Luke Kenneth Casson Leighton [Wed, 19 Aug 2020 00:15:33 +0000 (01:15 +0100)]
set up StageChain of 3 mul stages

3 years agofu/mul/test/test_pipe_caller.py test case_all_rb_close_to_ov change rb
Cole Poirier [Tue, 18 Aug 2020 21:15:20 +0000 (14:15 -0700)]
fu/mul/test/test_pipe_caller.py test case_all_rb_close_to_ov change rb
dividend from randint(0,1) to randint((-1 << 31), (1 << 31) - 1)

3 years agoadd testcase for LDSTSplitter using PortInterface
Tobias Platen [Tue, 18 Aug 2020 17:50:43 +0000 (19:50 +0200)]
add testcase for LDSTSplitter using PortInterface

3 years agofix spr state test
Luke Kenneth Casson Leighton [Tue, 18 Aug 2020 11:39:51 +0000 (12:39 +0100)]
fix spr state test

3 years agoadd comment in dcache.py
Luke Kenneth Casson Leighton [Tue, 18 Aug 2020 00:34:15 +0000 (01:34 +0100)]
add comment in dcache.py

3 years agodcache.py commit today's progress on translating dcache.vhdl
Cole Poirier [Mon, 17 Aug 2020 23:46:12 +0000 (16:46 -0700)]
dcache.py commit today's progress on translating dcache.vhdl

3 years agoCreate file experiment/wb_types.py to mirror microwatt wishbone_types.vhdl
Cole Poirier [Mon, 17 Aug 2020 23:44:55 +0000 (16:44 -0700)]
Create file experiment/wb_types.py to mirror microwatt wishbone_types.vhdl

3 years agomove Mask to nmutil
Luke Kenneth Casson Leighton [Mon, 17 Aug 2020 11:10:33 +0000 (12:10 +0100)]
move Mask to nmutil

3 years agoturn SelectableInt less/greater into signed versions.
Luke Kenneth Casson Leighton [Mon, 17 Aug 2020 09:59:49 +0000 (10:59 +0100)]
turn SelectableInt less/greater into signed versions.
may have ramifications as use of these operators assumes
unsigned

3 years agouse longer memtest in litex sim
Luke Kenneth Casson Leighton [Mon, 17 Aug 2020 09:59:04 +0000 (10:59 +0100)]
use longer memtest in litex sim

3 years agoadjust litex bios cmp test
Luke Kenneth Casson Leighton [Mon, 17 Aug 2020 09:58:20 +0000 (10:58 +0100)]
adjust litex bios cmp test

3 years agofix signed variants of cmp in alu
Luke Kenneth Casson Leighton [Mon, 17 Aug 2020 09:57:30 +0000 (10:57 +0100)]
fix signed variants of cmp in alu

3 years agoadd new cmp test for alu
Luke Kenneth Casson Leighton [Mon, 17 Aug 2020 09:56:48 +0000 (10:56 +0100)]
add new cmp test for alu

3 years agouse shift module in mmu. to be moved to nmutil
Luke Kenneth Casson Leighton [Mon, 17 Aug 2020 09:40:14 +0000 (10:40 +0100)]
use shift module in mmu. to be moved to nmutil

3 years agommu.py fix formatting 80 char limit
Cole Poirier [Sun, 16 Aug 2020 18:07:02 +0000 (11:07 -0700)]
mmu.py fix formatting 80 char limit

3 years agoattempting to track down bug in litex bios memtest
Luke Kenneth Casson Leighton [Sun, 16 Aug 2020 17:29:12 +0000 (18:29 +0100)]
attempting to track down bug in litex bios memtest

3 years agoread delay on getting regfile data
Luke Kenneth Casson Leighton [Sun, 16 Aug 2020 16:27:01 +0000 (17:27 +0100)]
read delay on getting regfile data

3 years agolimit debug reporting in litex sim to range of pc
Luke Kenneth Casson Leighton [Sun, 16 Aug 2020 14:28:15 +0000 (15:28 +0100)]
limit debug reporting in litex sim to range of pc

3 years agocmp test from litex bios
Luke Kenneth Casson Leighton [Sun, 16 Aug 2020 14:27:56 +0000 (15:27 +0100)]
cmp test from litex bios

3 years agoremove vhdl comments
Luke Kenneth Casson Leighton [Sun, 16 Aug 2020 13:25:41 +0000 (14:25 +0100)]
remove vhdl comments

3 years agouse simple one-line mask-generation
Luke Kenneth Casson Leighton [Sun, 16 Aug 2020 13:22:36 +0000 (14:22 +0100)]
use simple one-line mask-generation

3 years agofix LD/ST pimem issue with rising_edge detection
Luke Kenneth Casson Leighton [Sun, 16 Aug 2020 12:16:22 +0000 (13:16 +0100)]
fix LD/ST pimem issue with rising_edge detection

3 years agomissing vars, spelling corrections
Luke Kenneth Casson Leighton [Sun, 16 Aug 2020 10:25:55 +0000 (11:25 +0100)]
missing vars, spelling corrections

3 years agobig reorg, shuffle code to functions, makes the FSM clearer
Luke Kenneth Casson Leighton [Sun, 16 Aug 2020 10:11:48 +0000 (11:11 +0100)]
big reorg, shuffle code to functions, makes the FSM clearer

3 years agospelling error, move perm_ok to local
Luke Kenneth Casson Leighton [Sun, 16 Aug 2020 09:51:32 +0000 (10:51 +0100)]
spelling error, move perm_ok to local

3 years agomore comment removal
Luke Kenneth Casson Leighton [Sun, 16 Aug 2020 09:47:39 +0000 (10:47 +0100)]
more comment removal

3 years agomore remove comments
Luke Kenneth Casson Leighton [Sun, 16 Aug 2020 09:46:45 +0000 (10:46 +0100)]
more remove comments

3 years agoremoving more comments, tidyup
Luke Kenneth Casson Leighton [Sun, 16 Aug 2020 09:36:18 +0000 (10:36 +0100)]
removing more comments, tidyup

3 years agorestore incorrect removal of zero-Cat at LHS (should never do that)
Luke Kenneth Casson Leighton [Sun, 16 Aug 2020 09:21:09 +0000 (10:21 +0100)]
restore incorrect removal of zero-Cat at LHS (should never do that)

3 years agocontinue tidyup, comment removal/review. use byte_reverse function
Luke Kenneth Casson Leighton [Sun, 16 Aug 2020 09:20:04 +0000 (10:20 +0100)]
continue tidyup, comment removal/review.  use byte_reverse function

3 years agofix batch of syntax errors found by running mmu.py
Luke Kenneth Casson Leighton [Sun, 16 Aug 2020 09:05:30 +0000 (10:05 +0100)]
fix batch of syntax errors found by running mmu.py

3 years agobegin tidyup, removing comments after line-by-line review, remove MMU1, self.
Luke Kenneth Casson Leighton [Sun, 16 Aug 2020 09:01:51 +0000 (10:01 +0100)]
begin tidyup, removing comments after line-by-line review, remove MMU1, self.

3 years agoMerge branch 'master' of git.libre-soc.org:soc
Cole Poirier [Sat, 15 Aug 2020 23:49:16 +0000 (16:49 -0700)]
Merge branch 'master' of git.libre-soc.org:soc

3 years agommu.py fix Cat() semantics fixes https://bugs.libre-soc.org/show_bug.cgi?id=450#c51
Cole Poirier [Sat, 15 Aug 2020 23:48:27 +0000 (16:48 -0700)]
mmu.py fix Cat() semantics fixes https://bugs.libre-soc.org/show_bug.cgi?id=450#c51

3 years agothanks to daveshah, added simulation of dram
Luke Kenneth Casson Leighton [Sat, 15 Aug 2020 23:20:00 +0000 (00:20 +0100)]
thanks to daveshah, added simulation of dram
https://github.com/litex-hub/linux-on-litex-vexriscv/issues/84

this allows to track down a bug in the DDR3 memory test which is also
occurring in the FPGA version

3 years agommu.py fixes https://bugs.libre-soc.org/show_bug.cgi?id=450#c54
Cole Poirier [Sat, 15 Aug 2020 23:18:29 +0000 (16:18 -0700)]
mmu.py fixes https://bugs.libre-soc.org/show_bug.cgi?id=450#c54

3 years agommu.py fixes https://bugs.libre-soc.org/show_bug.cgi?id=450#c53
Cole Poirier [Sat, 15 Aug 2020 23:17:14 +0000 (16:17 -0700)]
mmu.py fixes https://bugs.libre-soc.org/show_bug.cgi?id=450#c53

3 years agommu.py fixes https://bugs.libre-soc.org/show_bug.cgi?id=450#c52
Cole Poirier [Sat, 15 Aug 2020 23:14:00 +0000 (16:14 -0700)]
mmu.py fixes https://bugs.libre-soc.org/show_bug.cgi?id=450#c52

3 years agorather big change to interaction between regfile and compunits on read
Luke Kenneth Casson Leighton [Sat, 15 Aug 2020 21:54:50 +0000 (22:54 +0100)]
rather big change to interaction between regfile and compunits on read
regfiles are now sync-delayed by one clock from "ren".  this means that
a read-request has to be fired off then excluded from the PriorityPicker,
whilst waiting for the output to arrive on the next clock.  *then*
the "go read" signal can be fired, which gets the data (arriving 1 cycle
late from the regfile) "in sync" with its "go read"

3 years agoclear compalu data latch always on issue
Luke Kenneth Casson Leighton [Sat, 15 Aug 2020 21:33:25 +0000 (22:33 +0100)]
clear compalu data latch always on issue

3 years agoDemonstrates string traces
Cesar Strauss [Fri, 14 Aug 2020 11:25:36 +0000 (08:25 -0300)]
Demonstrates string traces

When declaring a Signal, you can pass a custom decoder that translates
the Signal logic level to a string. nMigen uses this internally to
display Enum traces, but it is available for general use.

Some applications are:
1) Display a string when a signal is at high level, otherwise show a
single horizontal line. Useful to draw attention to a time interval.
2) Display the stages of a unit test
3) Display arbitrary debug statements along the timeline.

3 years agoDemonstrates adding extra debug signals traces to the dump file
Cesar Strauss [Fri, 14 Aug 2020 11:06:49 +0000 (08:06 -0300)]
Demonstrates adding extra debug signals traces to the dump file

At simulation time, you can declare a new signal, and use it inside
the test case, as any other signal. By including it in the "traces"
parameter of Simulator.write_vcd, it is included in the trace dump file.

Useful for adding "printf" style debugging for GTKWave.

3 years agoDemonstrates creating stylish GTKWave "save" files from python
Cesar Strauss [Thu, 13 Aug 2020 22:40:35 +0000 (19:40 -0300)]
Demonstrates creating stylish GTKWave "save" files from python

This is inspired on the use of the vcd.gtkw module in nMigen, used
internally to create "save" files of selected Signals, for
"Simulator.write_vcd".

However, the vcd.gtkw module exposes a great deal of extra possibilities,
like:

1) Individual trace colors.
For instance, use different color styles for input, output, debug and
internal traces.
2) Numeric bases besides the default hex.
3) Collapsible trace groups
Useful to hide and show, at once, groups of debug, internal and
sub-module traces.
Select the opening or closing brace, then use the T key.
4) Comments in the signal names pane
5) Change the displayed name of a trace
6) Sane default for initial zoom level
7) Place markers on interesting places
8) Put the generating file name as a comment in the file

3 years agoremove latchregister, use sync to capture compunit results
Luke Kenneth Casson Leighton [Fri, 14 Aug 2020 23:03:49 +0000 (00:03 +0100)]
remove latchregister, use sync to capture compunit results

3 years agoha! "state" (pc, msr) not properly passed to core
Luke Kenneth Casson Leighton [Fri, 14 Aug 2020 20:32:09 +0000 (21:32 +0100)]
ha! "state" (pc, msr) not properly passed to core

3 years agodrop in insn_state synchronously in issuer, at same time as insn
Luke Kenneth Casson Leighton [Fri, 14 Aug 2020 20:03:40 +0000 (21:03 +0100)]
drop in insn_state synchronously in issuer, at same time as insn

3 years agosubmodule update
Luke Kenneth Casson Leighton [Fri, 14 Aug 2020 19:45:31 +0000 (20:45 +0100)]
submodule update

3 years agohrfid unit test sets up HSRR0 and HSRR1
Luke Kenneth Casson Leighton [Fri, 14 Aug 2020 19:45:22 +0000 (20:45 +0100)]
hrfid unit test sets up HSRR0 and HSRR1

3 years agobad hack to get HSRR0/1 to be "same" as SRR0/1
Luke Kenneth Casson Leighton [Fri, 14 Aug 2020 19:44:59 +0000 (20:44 +0100)]
bad hack to get HSRR0/1 to be "same" as SRR0/1

3 years agobug in isa parser not recognising MSR as declared variable
Luke Kenneth Casson Leighton [Fri, 14 Aug 2020 19:44:35 +0000 (20:44 +0100)]
bug in isa parser not recognising MSR as declared variable

3 years agohack to get hrfid not to alter msr 51
Luke Kenneth Casson Leighton [Fri, 14 Aug 2020 19:43:56 +0000 (20:43 +0100)]
hack to get hrfid not to alter msr 51

3 years agostop trying to read swap files
Luke Kenneth Casson Leighton [Fri, 14 Aug 2020 19:43:08 +0000 (20:43 +0100)]
stop trying to read swap files

3 years agosync on alu results in compalu
Luke Kenneth Casson Leighton [Fri, 14 Aug 2020 19:23:34 +0000 (20:23 +0100)]
sync on alu results in compalu

3 years agoupdate submodule, add hrfid
Luke Kenneth Casson Leighton [Fri, 14 Aug 2020 17:25:17 +0000 (18:25 +0100)]
update submodule, add hrfid

3 years agoupdate submodule, add hrfid
Luke Kenneth Casson Leighton [Fri, 14 Aug 2020 17:23:33 +0000 (18:23 +0100)]
update submodule, add hrfid

3 years agofinally, fix decoder combinatorial loop
Luke Kenneth Casson Leighton [Fri, 14 Aug 2020 17:18:48 +0000 (18:18 +0100)]
finally, fix decoder combinatorial loop

3 years agofix test_compunit.py after moving decoder rdflags function
Luke Kenneth Casson Leighton [Fri, 14 Aug 2020 17:18:18 +0000 (18:18 +0100)]
fix test_compunit.py after moving decoder rdflags function

3 years agoadd hrfid unit test
Luke Kenneth Casson Leighton [Fri, 14 Aug 2020 17:17:48 +0000 (18:17 +0100)]
add hrfid unit test

3 years agosync up the core decode-execute state,
Luke Kenneth Casson Leighton [Fri, 14 Aug 2020 14:48:05 +0000 (15:48 +0100)]
sync up the core decode-execute state,
fix bug when pulling reset

3 years agomove instruction decoder out of core
Luke Kenneth Casson Leighton [Fri, 14 Aug 2020 14:26:10 +0000 (15:26 +0100)]
move instruction decoder out of core

3 years agomove regspec / rdflag decoding functions out of PowerDecode2
Luke Kenneth Casson Leighton [Fri, 14 Aug 2020 14:05:05 +0000 (15:05 +0100)]
move regspec / rdflag decoding functions out of PowerDecode2

3 years agosort out instruction stop/cancel when adding a new issuer FSM state
Luke Kenneth Casson Leighton [Fri, 14 Aug 2020 13:57:54 +0000 (14:57 +0100)]
sort out instruction stop/cancel when adding a new issuer FSM state

3 years agoput multi-ports back (for read) on int and fast regfiles
Luke Kenneth Casson Leighton [Fri, 14 Aug 2020 11:59:01 +0000 (12:59 +0100)]
put multi-ports back (for read) on int and fast regfiles

3 years agoreduce decoder pathways when exception occurs
Luke Kenneth Casson Leighton [Fri, 14 Aug 2020 11:10:06 +0000 (12:10 +0100)]
reduce decoder pathways when exception occurs

3 years agodivide shiftrot pipeline into 2 (simple last)
Luke Kenneth Casson Leighton [Thu, 13 Aug 2020 23:26:00 +0000 (00:26 +0100)]
divide shiftrot pipeline into 2 (simple last)

3 years agodivide alu pipeline into 2 (simple last)
Luke Kenneth Casson Leighton [Thu, 13 Aug 2020 23:25:36 +0000 (00:25 +0100)]
divide alu pipeline into 2 (simple last)

3 years agodivide logical pipe into 2 (simple phase last)
Luke Kenneth Casson Leighton [Thu, 13 Aug 2020 23:19:34 +0000 (00:19 +0100)]
divide logical pipe into 2 (simple phase last)

3 years agorunning the simulator works!
Jacob Lifshay [Fri, 14 Aug 2020 04:22:01 +0000 (21:22 -0700)]
running the simulator works!

3 years agoadd --cpu=libresoc to Makefile
Jacob Lifshay [Thu, 13 Aug 2020 23:18:03 +0000 (16:18 -0700)]
add --cpu=libresoc to Makefile

3 years agofix dmi reg read
Luke Kenneth Casson Leighton [Thu, 13 Aug 2020 21:44:29 +0000 (22:44 +0100)]
fix dmi reg read

3 years agocode-shuffle
Luke Kenneth Casson Leighton [Thu, 13 Aug 2020 21:23:18 +0000 (22:23 +0100)]
code-shuffle

3 years agoremove use of latchregigister, replace with sync on rd.go_i
Luke Kenneth Casson Leighton [Thu, 13 Aug 2020 21:23:08 +0000 (22:23 +0100)]
remove use of latchregigister, replace with sync on rd.go_i

3 years agosync on pc writing when changed
Luke Kenneth Casson Leighton [Thu, 13 Aug 2020 20:33:25 +0000 (21:33 +0100)]
sync on pc writing when changed

3 years agodcache.py add initial imports
Cole Poirier [Thu, 13 Aug 2020 19:05:10 +0000 (12:05 -0700)]
dcache.py add initial imports

3 years agomem_types.py add more types from common.vhdl
Cole Poirier [Thu, 13 Aug 2020 19:01:11 +0000 (12:01 -0700)]
mem_types.py add more types from common.vhdl

3 years agomove memory related types from mmu.py into new file mem_types.py as they
Cole Poirier [Thu, 13 Aug 2020 18:45:25 +0000 (11:45 -0700)]
move memory related types from mmu.py into new file mem_types.py as they
are used by icache and dcache as well

3 years agosync on reset in compalu
Luke Kenneth Casson Leighton [Thu, 13 Aug 2020 17:42:12 +0000 (18:42 +0100)]
sync on reset in compalu

3 years agoadd forwarding-bus mode to Regfile Memory (and disable it)
Luke Kenneth Casson Leighton [Thu, 13 Aug 2020 16:52:33 +0000 (17:52 +0100)]
add forwarding-bus mode to Regfile Memory (and disable it)

3 years agosync on port interface address in ld/st compunit, and use sync on oper_i
Luke Kenneth Casson Leighton [Thu, 13 Aug 2020 15:49:35 +0000 (16:49 +0100)]
sync on port interface address in ld/st compunit, and use sync on oper_i

3 years agoanother sync to cut latency
Luke Kenneth Casson Leighton [Thu, 13 Aug 2020 15:49:07 +0000 (16:49 +0100)]
another sync to cut latency

3 years agoInitial commit of translation of microwatt dcache.vhdl into nmigen
Cole Poirier [Thu, 13 Aug 2020 15:30:27 +0000 (08:30 -0700)]
Initial commit of translation of microwatt dcache.vhdl into nmigen

3 years agoremove latchregister, sync src oper_i into MultiCompUnit
Luke Kenneth Casson Leighton [Thu, 13 Aug 2020 14:46:58 +0000 (15:46 +0100)]
remove latchregister, sync src oper_i into MultiCompUnit

3 years agominor tidyup on alu compunit:
Luke Kenneth Casson Leighton [Thu, 13 Aug 2020 14:23:34 +0000 (15:23 +0100)]
minor tidyup on alu compunit:
* sync on oper_r because there is time to wait for src reads
* get immediates from op not oper_r
* use rising_edge rather than manual pulse creation

3 years agoplenty of time to wait for operand, so use "sync" in MultiCompUnit
Luke Kenneth Casson Leighton [Thu, 13 Aug 2020 12:59:48 +0000 (13:59 +0100)]
plenty of time to wait for operand, so use "sync" in MultiCompUnit

3 years agosigh. convert Fast regfile to binary
Luke Kenneth Casson Leighton [Thu, 13 Aug 2020 12:34:36 +0000 (13:34 +0100)]
sigh.  convert Fast regfile to binary

3 years agosync on read of regfile ports
Luke Kenneth Casson Leighton [Thu, 13 Aug 2020 11:45:52 +0000 (12:45 +0100)]
sync on read of regfile ports

3 years agosigh. convert INT regfile to binary addressing
Luke Kenneth Casson Leighton [Thu, 13 Aug 2020 11:25:32 +0000 (12:25 +0100)]
sigh.  convert INT regfile to binary addressing

3 years agocreate a RegFileMem class that uses Memory
Luke Kenneth Casson Leighton [Wed, 12 Aug 2020 15:50:03 +0000 (16:50 +0100)]
create a RegFileMem class that uses Memory

3 years agoadd run_sim to Makefile
Jacob Lifshay [Wed, 12 Aug 2020 21:23:58 +0000 (14:23 -0700)]
add run_sim to Makefile

3 years agommu.py add skeleton sim and test functions from regfile/regfile.py
Cole Poirier [Wed, 12 Aug 2020 18:55:20 +0000 (11:55 -0700)]
mmu.py add skeleton sim and test functions from regfile/regfile.py

3 years agoDelete unnecessary mmu dir, move mmu.py out of mmu dir back to
Cole Poirier [Wed, 12 Aug 2020 18:53:51 +0000 (11:53 -0700)]
Delete unnecessary mmu dir, move mmu.py out of mmu dir back to
experiment dir

3 years agoRevert "Remove mmu dir and associated mmu/test/ dir" because I forgot to
Cole Poirier [Wed, 12 Aug 2020 18:52:05 +0000 (11:52 -0700)]
Revert "Remove mmu dir and associated mmu/test/ dir" because I forgot to
add mmu.py to the commit, so it shows deleted instead of renamed/moved

This reverts commit e97b5223a871498a9dd434103b2ecd4a13c06440.

3 years agoRemove mmu dir and associated mmu/test/ dir
Cole Poirier [Wed, 12 Aug 2020 18:45:20 +0000 (11:45 -0700)]
Remove mmu dir and associated mmu/test/ dir