Thursday, 2021-12-02

lkclthat would be a great one to have under the new FOSDEM VLSI/FPGA devroom https://libre-soc.org/conferences/fosdem2022/13:12
lkclpaul, mikey et al, i wanted to ask: how the heck does the register file hazard-protection work in microwatt?13:13
lkcli'm seeing this https://github.com/antonblanchard/microwatt/blob/master/writeback.vhdl13:13
lkcland it looks like it's creating an exclusive per-pipeline "spinlock", if you will13:14
lkclit seems that the principle is: only one pipeline (of which it now looks like there are 3) at a time is permitted write-access to regfiles13:14
lkclalthough that's not making sense.13:16
lkclah ha!  is this it?13:17
lkclcommon.vhdl13:17
lkclDecode2ToExecute13:17
lkclread_data1: std_ulogic_vector(63 downto 0);13:17
lkclread_data2: std_ulogic_vector(63 downto 0);13:17
lkclnope, that's the data in (*from* the regfiles), isn't it13:18
lkclthere must _be_ some read-after-write and write-after-read hazard protection, otherwise you get catastrophic data corruption13:19
lkcli just can't find it! :)13:20
lkclahhhh https://github.com/antonblanchard/microwatt/blob/7fa7b45faa17950de44591f7a73722fdf8a87385/control.vhdl#L13613:20
lkclah.  pipeline stage length counting :)13:22
lkclonly works for things with guaranteed (fixed) pipeline lengths13:23
lkclFP and DIV, being FSMs of indeterminate length, would not fit that, nor, strictly, would LD/sT based on stalls from the Wishbone Bus. but everything else, yeah. nice13:24
lkclsorry. LDs.  STs would be fine (ish) but LDs would not.  the wishbone bus is not fixed / guaranteed length (outside of the control of the core due to wishbone stall signals)13:25
openpowerbot[mattermost] <lkcl> in Libre-SOC i have a Set-Reset (SR) Latch (okok, actually a DFF register which has some if-statements that prioritise "reset" - set to 0 - over "set" - set to 1)15:45
openpowerbot[mattermost] <lkcl> and that's a bitvector15:46
openpowerbot[mattermost] <lkcl> where decoding of reads (RA, RB, RC, RS aka in1/in2/in3) will set the relevant bit (0..31)15:46
openpowerbot[mattermost] <lkcl> and on write the corresponding bit is cleared15:47
openpowerbot[mattermost] <lkcl> means that the same bitvector hazard protection can cover FSMs such as FP pipeline operations, and DIV, and indeterminate-lengthed-LD operations15:47

Generated by irclog2html.py 2.17.1 by Marius Gedminas - find it at https://mg.pov.lt/irclog2html/!