soc.git
2 years agoTODO comments about using MSRspec
Luke Kenneth Casson Leighton [Mon, 13 Dec 2021 12:29:06 +0000 (12:29 +0000)]
TODO comments about using MSRspec

2 years agochange PortInterface naming to msr not msr_pr in set_wr_addr
Luke Kenneth Casson Leighton [Mon, 13 Dec 2021 12:26:35 +0000 (12:26 +0000)]
change PortInterface naming to msr not msr_pr in set_wr_addr
and set_rd_addr.  the name-change does not affect any code at the moment

2 years agoadd namedtuple proposed by lkcl in chat
Tobias Platen [Mon, 13 Dec 2021 12:01:45 +0000 (13:01 +0100)]
add namedtuple proposed by lkcl in chat

2 years agoadd signals to port interface as descibed in bug 756
Tobias Platen [Mon, 13 Dec 2021 10:41:24 +0000 (11:41 +0100)]
add signals to port interface as descibed in bug 756

2 years agomore work on test_loadstore1_ifetch_multi()
Tobias Platen [Mon, 13 Dec 2021 09:45:50 +0000 (10:45 +0100)]
more work on test_loadstore1_ifetch_multi()

2 years agoset and reset instruction fault so it does not occur twice
Luke Kenneth Casson Leighton [Sun, 12 Dec 2021 21:08:35 +0000 (21:08 +0000)]
set and reset instruction fault so it does not occur twice

2 years agowhen an exception happens, if it is a fetch_failed take the
Luke Kenneth Casson Leighton [Sun, 12 Dec 2021 20:45:49 +0000 (20:45 +0000)]
when an exception happens, if it is a fetch_failed take the
exception from the MMU not from LDST.

at some point need a much more sophisticated way of detecting which
unit created which exception

2 years agodelay MMU LOOKUP done by one clock so that the exception matches timing
Luke Kenneth Casson Leighton [Sun, 12 Dec 2021 20:45:04 +0000 (20:45 +0000)]
delay MMU LOOKUP done by one clock so that the exception matches timing

2 years agobring MMU exception out where AllFunctionUnits (and then core)
Luke Kenneth Casson Leighton [Sun, 12 Dec 2021 20:44:26 +0000 (20:44 +0000)]
bring MMU exception out where AllFunctionUnits (and then core)
can get at it

2 years agobring exception out from MMU FSM, correct "done"
Luke Kenneth Casson Leighton [Sun, 12 Dec 2021 20:18:46 +0000 (20:18 +0000)]
bring exception out from MMU FSM, correct "done"
signal output on OP_FETCH_FAILED

2 years agoadd LDSTException output to MMU
Luke Kenneth Casson Leighton [Sun, 12 Dec 2021 20:05:50 +0000 (20:05 +0000)]
add LDSTException output to MMU

2 years agodrat, a test inverting the instruction made it into the git history
Luke Kenneth Casson Leighton [Sun, 12 Dec 2021 19:10:36 +0000 (19:10 +0000)]
drat, a test inverting the instruction made it into the git history

2 years agostarting to hack in fetch failed (including OP_FETCH_FAILED)
Luke Kenneth Casson Leighton [Sun, 12 Dec 2021 18:56:13 +0000 (18:56 +0000)]
starting to hack in fetch failed (including OP_FETCH_FAILED)
going really badly as far as code-readability and clean design is concerned
but is progressing

a truly dreadful hack: OP_TRAP works (LDST Exceptions) because the
main decoder (PowerDecoder2) is used by core for the Trap pipeline.

unnnnfortunately... for MMU, a *Satellite* decoder (PowerDecodeSubset)
is used.  and Satellite decoders *only* understand *instructions*.
(which they part-decode locally).

therefore a manual override of the satellite decoder insn_type
and fn_unit is required when OP_FETCH_FAILED occurs.

truly awful.

2 years agoprint debugs established that when a wb_get memory dictionary is
Luke Kenneth Casson Leighton [Sun, 12 Dec 2021 15:47:10 +0000 (15:47 +0000)]
print debugs established that when a wb_get memory dictionary is
passed in, trying to use setup_i_memory and setup_tst_memory will not
work.

using wb_get has to be established a different way

2 years agoset fetch_failed into PowerDecoder2 combinatorially
Luke Kenneth Casson Leighton [Sun, 12 Dec 2021 15:44:50 +0000 (15:44 +0000)]
set fetch_failed into PowerDecoder2 combinatorially

2 years agoin a terrible botched way, get at I-Cache and set it up
Luke Kenneth Casson Leighton [Sun, 12 Dec 2021 13:15:51 +0000 (13:15 +0000)]
in a terrible botched way, get at I-Cache and set it up
this is for adding in I-Cache and MMU into core.

2 years agofix bug in unit test, forgot that wb_get mem dict is 64-bit wide data
Luke Kenneth Casson Leighton [Sat, 11 Dec 2021 23:49:48 +0000 (23:49 +0000)]
fix bug in unit test, forgot that wb_get mem dict is 64-bit wide data
it cannot cope with addresses non-aligned to 64-bit boundary

2 years agoget FetchUnitInterface I-Cache test working (sort-of)
Luke Kenneth Casson Leighton [Sat, 11 Dec 2021 23:42:53 +0000 (23:42 +0000)]
get FetchUnitInterface I-Cache test working (sort-of)
bug in reading addresses 0xc.  0x8 and 0x10 are fine

2 years agocomment out broken test
Luke Kenneth Casson Leighton [Sat, 11 Dec 2021 23:19:34 +0000 (23:19 +0000)]
comment out broken test

2 years agowhoops forgot to add pspec
Luke Kenneth Casson Leighton [Sat, 11 Dec 2021 23:19:04 +0000 (23:19 +0000)]
whoops forgot to add pspec

2 years agotypo fix, add missing stop statement to _test_loadstore1_ifetch_multi()
Tobias Platen [Sat, 11 Dec 2021 16:14:25 +0000 (17:14 +0100)]
typo fix, add missing stop statement to _test_loadstore1_ifetch_multi()

2 years agoadd loop with multiple instructions for testing
Tobias Platen [Sat, 11 Dec 2021 16:10:18 +0000 (17:10 +0100)]
add loop with multiple instructions for testing

2 years agoadd skeleton for test_loadstore1_ifetch_multi()
Tobias Platen [Sat, 11 Dec 2021 16:02:51 +0000 (17:02 +0100)]
add skeleton for test_loadstore1_ifetch_multi()

2 years agoadd start of test_loadstore1_ifetch_unit_interface()
Luke Kenneth Casson Leighton [Sat, 11 Dec 2021 15:47:05 +0000 (15:47 +0000)]
add start of test_loadstore1_ifetch_unit_interface()
which is supposed to use FetchUnitInterface like the imem.py unit test
unfinished

2 years agoconnect up I-Cache to FetchUnitInterface
Luke Kenneth Casson Leighton [Sat, 11 Dec 2021 14:36:58 +0000 (14:36 +0000)]
connect up I-Cache to FetchUnitInterface
FetchUnitInterface may in turn need redesigning, but that is another story

2 years agoadd new ConfigFetchUnit option "mmu_cache_wb" which connects up
Luke Kenneth Casson Leighton [Sat, 11 Dec 2021 14:18:47 +0000 (14:18 +0000)]
add new ConfigFetchUnit option "mmu_cache_wb" which connects up
directly to LoadstStore1 I-Cache

2 years agoadd ternlogi to shift_rot formal test
Jacob Lifshay [Fri, 10 Dec 2021 21:54:22 +0000 (13:54 -0800)]
add ternlogi to shift_rot formal test

2 years agofix shift_rot formal proof
Jacob Lifshay [Fri, 10 Dec 2021 21:32:46 +0000 (13:32 -0800)]
fix shift_rot formal proof

2 years agoadd formal_test_temp to .gitignore
Jacob Lifshay [Fri, 10 Dec 2021 21:32:20 +0000 (13:32 -0800)]
add formal_test_temp to .gitignore

2 years agouse icache_read in one place
Tobias Platen [Fri, 10 Dec 2021 20:29:07 +0000 (21:29 +0100)]
use icache_read in one place

2 years agotest_loadstore1.py: begin code deduplication
Tobias Platen [Fri, 10 Dec 2021 19:30:14 +0000 (20:30 +0100)]
test_loadstore1.py: begin code deduplication

2 years agoadd some examination of the failed-fetched instruction
Luke Kenneth Casson Leighton [Thu, 9 Dec 2021 20:47:52 +0000 (20:47 +0000)]
add some examination of the failed-fetched instruction
and check that it is a perm_error and an instruction fault

2 years agoadd some debug string info to gtkwave
Luke Kenneth Casson Leighton [Thu, 9 Dec 2021 20:15:40 +0000 (20:15 +0000)]
add some debug string info to gtkwave

2 years agoimplement main part of test_loadstore1_ifetch_invalid()
Tobias Platen [Thu, 9 Dec 2021 17:32:13 +0000 (18:32 +0100)]
implement main part of test_loadstore1_ifetch_invalid()

2 years agocleanup test_loadstore1.py
Tobias Platen [Thu, 9 Dec 2021 16:56:04 +0000 (17:56 +0100)]
cleanup test_loadstore1.py

2 years agoadd I-Cache to FSM local variables
Luke Kenneth Casson Leighton [Thu, 9 Dec 2021 15:45:33 +0000 (15:45 +0000)]
add I-Cache to FSM local variables

2 years agowire fetch_failed from I-Cache to PowerDecoder2
Luke Kenneth Casson Leighton [Thu, 9 Dec 2021 15:45:09 +0000 (15:45 +0000)]
wire fetch_failed from I-Cache to PowerDecoder2
informs PowerDecoder2 that an instruction fetch failed in MMU mode

2 years agomake icache accessible to core, working back to TestIssuer
Luke Kenneth Casson Leighton [Thu, 9 Dec 2021 15:06:07 +0000 (15:06 +0000)]
make icache accessible to core, working back to TestIssuer

2 years agoinclude SPR.TB in SPR FU
Luke Kenneth Casson Leighton [Thu, 9 Dec 2021 09:53:25 +0000 (09:53 +0000)]
include SPR.TB in SPR FU

2 years agoadd bitmanip tests
Jacob Lifshay [Thu, 9 Dec 2021 06:05:15 +0000 (22:05 -0800)]
add bitmanip tests

2 years agoadd CommonPipeSpec.__getattr__ to forward attributes from parent_pspec
Jacob Lifshay [Thu, 9 Dec 2021 04:00:45 +0000 (20:00 -0800)]
add CommonPipeSpec.__getattr__ to forward attributes from parent_pspec

replaces CommonPipeSpec.draft_bitmanip

2 years agoadd parent_pspec everywhere
Jacob Lifshay [Thu, 9 Dec 2021 03:56:36 +0000 (19:56 -0800)]
add parent_pspec everywhere

2 years agomake argv handling more flexible
Jacob Lifshay [Thu, 9 Dec 2021 03:49:42 +0000 (19:49 -0800)]
make argv handling more flexible

2 years agoformat code
Jacob Lifshay [Thu, 9 Dec 2021 03:41:01 +0000 (19:41 -0800)]
format code

2 years agogot fed up of staring at magic constants in the MMU
Luke Kenneth Casson Leighton [Wed, 8 Dec 2021 22:34:42 +0000 (22:34 +0000)]
got fed up of staring at magic constants in the MMU
created a Record RPTE from v3.0C Book III p1016 section 7.7.10.2
to interpret the page-table leaf entries in words/features rather than
magic offsets

2 years agoadd special pagetable to ifetch_invalid with execute perms barred
Luke Kenneth Casson Leighton [Wed, 8 Dec 2021 21:32:03 +0000 (21:32 +0000)]
add special pagetable to ifetch_invalid with execute perms barred

2 years agodo not try priv_mode on the instruction fetch (not needed)
Luke Kenneth Casson Leighton [Wed, 8 Dec 2021 21:30:17 +0000 (21:30 +0000)]
do not try priv_mode on the instruction fetch (not needed)

2 years agoadd an example pagetable where executable permission is barred
Luke Kenneth Casson Leighton [Wed, 8 Dec 2021 21:29:51 +0000 (21:29 +0000)]
add an example pagetable where executable permission is barred

2 years agobegin working on _test_loadstore1_ifetch_invalid() inner function
Tobias Platen [Wed, 8 Dec 2021 21:03:55 +0000 (22:03 +0100)]
begin working on _test_loadstore1_ifetch_invalid() inner function

2 years agomore work on test_loadstore1_ifetch_invalid()
Tobias Platen [Wed, 8 Dec 2021 20:53:11 +0000 (21:53 +0100)]
more work on test_loadstore1_ifetch_invalid()

2 years agoMerge branch 'master' of ssh://git.libre-riscv.org:922/soc
Tobias Platen [Wed, 8 Dec 2021 20:19:13 +0000 (21:19 +0100)]
Merge branch 'master' of ssh://git.libre-riscv.org:922/soc

2 years agoadd skeleton for test_loadstore1_ifetch_invalid()
Tobias Platen [Wed, 8 Dec 2021 20:18:34 +0000 (21:18 +0100)]
add skeleton for test_loadstore1_ifetch_invalid()

2 years agocheck that no exception occurs in the virtual-memory-instruction-fetch
Luke Kenneth Casson Leighton [Wed, 8 Dec 2021 20:04:45 +0000 (20:04 +0000)]
check that no exception occurs in the virtual-memory-instruction-fetch

2 years agoadd OP_FETCH_FAILED to MMU Function Unit
Luke Kenneth Casson Leighton [Wed, 8 Dec 2021 19:08:32 +0000 (19:08 +0000)]
add OP_FETCH_FAILED to MMU Function Unit

2 years agomake LoadStore1 intsr_fault a "captured flag" - strictly speaking
Luke Kenneth Casson Leighton [Wed, 8 Dec 2021 16:43:43 +0000 (16:43 +0000)]
make LoadStore1 intsr_fault a "captured flag" - strictly speaking
there should be separate FSM states for MMU_LOOKUP_ICACHE but hey

2 years agoremove MSR and add CIA to MMU Input Record
Luke Kenneth Casson Leighton [Wed, 8 Dec 2021 16:42:32 +0000 (16:42 +0000)]
remove MSR and add CIA to MMU Input Record

2 years agoadd instr_fault to LoadStore1 FSM
Luke Kenneth Casson Leighton [Wed, 8 Dec 2021 16:09:28 +0000 (16:09 +0000)]
add instr_fault to LoadStore1 FSM
this includes stopping LoadStore1 from processing (accepting)
incoming LDST operations via its PortInterface

2 years agoadd new PortInterfaceBase external_busy() option
Luke Kenneth Casson Leighton [Wed, 8 Dec 2021 16:06:27 +0000 (16:06 +0000)]
add new PortInterfaceBase external_busy() option
this allows e.g. instruction fault to stop LD/STs from being accepted

2 years agoadd comment about draft instructions
Jacob Lifshay [Wed, 8 Dec 2021 01:55:46 +0000 (17:55 -0800)]
add comment about draft instructions

2 years agoaccount for Mock absurdities
Jacob Lifshay [Wed, 8 Dec 2021 01:51:14 +0000 (17:51 -0800)]
account for Mock absurdities

2 years agocomplete the i-cache fetch through the MMU, including doing an
Luke Kenneth Casson Leighton [Tue, 7 Dec 2021 16:07:18 +0000 (16:07 +0000)]
complete the i-cache fetch through the MMU, including doing an
instruction-side TLB lookup

2 years agoset separate "iside" signal in LoadStore1 to not confuse it
Luke Kenneth Casson Leighton [Tue, 7 Dec 2021 15:51:34 +0000 (15:51 +0000)]
set separate "iside" signal in LoadStore1 to not confuse it
with instr_fault (exception flag).  starting to experiment getting
instruction-side MMU requests to trigger

2 years agostart extending icache loadstore test
Luke Kenneth Casson Leighton [Tue, 7 Dec 2021 14:55:50 +0000 (14:55 +0000)]
start extending icache loadstore test

2 years agowhoops another serious error in the CacheTagArray
Luke Kenneth Casson Leighton [Tue, 7 Dec 2021 14:55:26 +0000 (14:55 +0000)]
whoops another serious error in the CacheTagArray
valid is of length NUM_WAYS not 1

2 years agoadd first i-cache fetch (non-virtual), no MMU lookup, copied unit
Luke Kenneth Casson Leighton [Tue, 7 Dec 2021 14:30:12 +0000 (14:30 +0000)]
add first i-cache fetch (non-virtual), no MMU lookup, copied unit
test from basic one in soc/experiment/icache.py

2 years agocode-comments
Luke Kenneth Casson Leighton [Tue, 7 Dec 2021 13:37:15 +0000 (13:37 +0000)]
code-comments

2 years agoadd in I-Cache into LoadStore1 - presently unused - so as to start on
Luke Kenneth Casson Leighton [Tue, 7 Dec 2021 13:32:16 +0000 (13:32 +0000)]
add in I-Cache into LoadStore1 - presently unused - so as to start on
a unit test (test_loadstore1.py).  this is not a normal place to start,
but I-Cache links cross-wise into so many other dependent areas that
it is quite tricky

2 years agoadd discussion links and bugreport
Luke Kenneth Casson Leighton [Tue, 7 Dec 2021 12:11:38 +0000 (12:11 +0000)]
add discussion links and bugreport

2 years agoinvert mmureq statements
Luke Kenneth Casson Leighton [Tue, 7 Dec 2021 01:12:33 +0000 (01:12 +0000)]
invert mmureq statements

2 years agosubmodule tidyup
Luke Kenneth Casson Leighton [Tue, 7 Dec 2021 01:06:04 +0000 (01:06 +0000)]
submodule tidyup

2 years agomake bitmanip operations conditional on pspec.draft_bitmanip
Jacob Lifshay [Tue, 7 Dec 2021 03:33:25 +0000 (19:33 -0800)]
make bitmanip operations conditional on pspec.draft_bitmanip

2 years agoformat code
Jacob Lifshay [Tue, 7 Dec 2021 03:26:40 +0000 (19:26 -0800)]
format code

2 years agomove rotator mode assignments as requested by lkcl
Jacob Lifshay [Tue, 7 Dec 2021 03:22:19 +0000 (19:22 -0800)]
move rotator mode assignments as requested by lkcl

2 years agoformat code
Jacob Lifshay [Tue, 7 Dec 2021 03:17:07 +0000 (19:17 -0800)]
format code

2 years agotidyup, comments
Luke Kenneth Casson Leighton [Tue, 7 Dec 2021 01:00:56 +0000 (01:00 +0000)]
tidyup, comments

2 years agodebug print
Luke Kenneth Casson Leighton [Tue, 7 Dec 2021 00:03:10 +0000 (00:03 +0000)]
debug print

2 years agoanother major bug, CacheTagArray valid was only 1 bit not NUM_WAYS
Luke Kenneth Casson Leighton [Mon, 6 Dec 2021 23:57:33 +0000 (23:57 +0000)]
another major bug, CacheTagArray valid was only 1 bit not NUM_WAYS

2 years agotidyup: move hit_set to DCachePendingHit in dcache.py
Luke Kenneth Casson Leighton [Mon, 6 Dec 2021 23:40:40 +0000 (23:40 +0000)]
tidyup: move hit_set to DCachePendingHit in dcache.py

2 years agodcache.py tidyup
Luke Kenneth Casson Leighton [Mon, 6 Dec 2021 23:35:44 +0000 (23:35 +0000)]
dcache.py tidyup

2 years agorename dtlb to dtlb_valid and tidyup
Luke Kenneth Casson Leighton [Mon, 6 Dec 2021 23:17:35 +0000 (23:17 +0000)]
rename dtlb to dtlb_valid and tidyup
remove dtlb argument (not needed) because dtlb_valid is now localised
to DTLBUpdate Module

also put in some code-comments

2 years agoconvert TLBArray to TLBValidArray
Luke Kenneth Casson Leighton [Mon, 6 Dec 2021 22:43:29 +0000 (22:43 +0000)]
convert TLBArray to TLBValidArray
(because PTE and TAG are now each in a Memory)

2 years agoconvert DTLBUpdate to use a pair of Memorys
Luke Kenneth Casson Leighton [Mon, 6 Dec 2021 22:41:58 +0000 (22:41 +0000)]
convert DTLBUpdate to use a pair of Memorys
one for PTEs and one for TAGs

2 years agomore signals local to DTLBUpdate
Luke Kenneth Casson Leighton [Mon, 6 Dec 2021 20:37:37 +0000 (20:37 +0000)]
more signals local to DTLBUpdate

2 years agomore signals local to DTLBUpdate
Luke Kenneth Casson Leighton [Mon, 6 Dec 2021 20:30:47 +0000 (20:30 +0000)]
more signals local to DTLBUpdate

2 years agoupdate DTLBUpdate to reflect internal API now
Luke Kenneth Casson Leighton [Mon, 6 Dec 2021 20:25:58 +0000 (20:25 +0000)]
update DTLBUpdate to reflect internal API now

2 years agoooo nasty bug. used tlb_hit.way instead of tlb_hit.valid
Luke Kenneth Casson Leighton [Mon, 6 Dec 2021 17:40:12 +0000 (17:40 +0000)]
ooo nasty bug.  used tlb_hit.way instead of tlb_hit.valid

2 years agomove DTLB Tags/Valids/PTEs into DTLBUpdate module
Luke Kenneth Casson Leighton [Mon, 6 Dec 2021 17:33:31 +0000 (17:33 +0000)]
move DTLB Tags/Valids/PTEs into DTLBUpdate module
drastically simplifies DCache graphviz and also makes it clear that
TLBs have to be a Memory SRAM

2 years agostart moving TLBArray into DTLBUpdate
Luke Kenneth Casson Leighton [Mon, 6 Dec 2021 17:14:45 +0000 (17:14 +0000)]
start moving TLBArray into DTLBUpdate

2 years agoPLRUs were selecting an output index, only one selected
Luke Kenneth Casson Leighton [Mon, 6 Dec 2021 17:00:29 +0000 (17:00 +0000)]
PLRUs were selecting an output index, only one selected
therefore move the selection from the PLRUs into the module.
simplified

2 years agorepeated copies of read/write addr/sel to Cache SRAMs
Luke Kenneth Casson Leighton [Mon, 6 Dec 2021 16:01:13 +0000 (16:01 +0000)]
repeated copies of read/write addr/sel to Cache SRAMs
moved rd/wr addr/sel outside of loops, only creates one MUX set now

2 years agomove bank of PLRUs to their own submodule in both dcache.py and icache.py
Luke Kenneth Casson Leighton [Mon, 6 Dec 2021 15:45:40 +0000 (15:45 +0000)]
move bank of PLRUs to their own submodule in both dcache.py and icache.py

2 years agocode-comments
Luke Kenneth Casson Leighton [Mon, 6 Dec 2021 14:49:20 +0000 (14:49 +0000)]
code-comments

2 years agouse binary-to-unary encoders in dcache.py
Luke Kenneth Casson Leighton [Mon, 6 Dec 2021 14:41:32 +0000 (14:41 +0000)]
use binary-to-unary encoders in dcache.py

2 years agoglobal (one) do_read signal in cache_rams dcache.py
Luke Kenneth Casson Leighton [Mon, 6 Dec 2021 14:11:45 +0000 (14:11 +0000)]
global (one) do_read signal in cache_rams dcache.py

2 years agouse one-hot binary-to-unary in dcache.py
Luke Kenneth Casson Leighton [Mon, 6 Dec 2021 14:01:56 +0000 (14:01 +0000)]
use one-hot binary-to-unary in dcache.py

2 years agouse i_in.req to gate hit_way via Decoder in icache.py
Luke Kenneth Casson Leighton [Mon, 6 Dec 2021 13:50:48 +0000 (13:50 +0000)]
use i_in.req to gate hit_way via Decoder in icache.py

2 years agouse Decoder (binary-to-unary) in icache.py to deal with CAM creation
Luke Kenneth Casson Leighton [Mon, 6 Dec 2021 13:36:04 +0000 (13:36 +0000)]
use Decoder (binary-to-unary) in icache.py to deal with CAM creation

2 years agouse unary encoding (one-hot) for replace_way hit_way etc.
Luke Kenneth Casson Leighton [Sun, 5 Dec 2021 23:16:28 +0000 (23:16 +0000)]
use unary encoding (one-hot) for replace_way hit_way etc.
otherwise it produces binary CAM-compares

2 years agocode-comments
Luke Kenneth Casson Leighton [Sun, 5 Dec 2021 22:02:49 +0000 (22:02 +0000)]
code-comments

2 years agowhitespace and minor cleanup of D-Cache
Luke Kenneth Casson Leighton [Sun, 5 Dec 2021 21:52:25 +0000 (21:52 +0000)]
whitespace and minor cleanup of D-Cache