?? gendc.vhd
字號:
-- O1 +--+--+ O1 O3 -- | | | -- O3<---O2 O4 -- | -- O4 -- $(/del) t.setrep := t.set; t.datapi_src := gdcdp_cm; end if; else if (not (t.hit and t.valid)) = '1' or (i.forceread = '1') then -- $(del) -- read -- Writeback | Writethrough -- +--------+--------+ -- hit |<MISS> hit | miss -- +----+----+ +----+----+ -- | free|dirty | | -- O1 +--+--+ O1 O3 -- | | | -- O3<---O2 O4 -- | -- O4 -- $(/del) v.hold := '1'; if t.dirty = '1' then v.state := gendc_wb_wbline; v.state_wbline_next := gendc_wtwb_readdata; else t.wbi.fifo_write := '1'; v.state := gendc_wtwb_readdata; end if; else -- $(del) -- read -- Writeback | Writethrough -- +--------+--------+ -- <HIT>| miss hit | miss -- +----+----+ +----+----+ -- | free|dirty | | -- O1 +--+--+ O1 O3 -- | | | -- O3<---O2 O4 -- | -- O4 -- $(/del) t.setrep := t.set; t.datapi_src := gdcdp_cm; end if; end if; else if ctrl.writeback = '0' then if (not (t.hit and t.valid)) = '1' then -- $(del) -- write -- writeback | Writethrough -- +--------+--------+ -- hit | miss hit |<MISS> -- +----+----+ +----+----+ -- | free|dirty | | -- O5 +--+--+ O4/O6 O6 -- | | -- O5<---O2 -- $(/del) if ctrl.allocateonstore = '1' then t.twrite := '1'; t.dwrite := '1'; end if; else -- $(del) -- write -- writeback | writethrough -- +--------+--------+ -- hit | miss <HIT>| miss -- +----+----+ +----+----+ -- | free|dirty | | -- O5 +--+--+ O4/O6 O6 -- | | -- O5<---O2 -- $(/del) t.setrep := t.set; t.twrite := '1'; t.dwrite := '1'; end if; v.state := gendc_wt_writedata; t.wbi.fifo_write := '1'; t.cmaddr_src := gdca_re; t.meaddr_src := gdcma_re; -- addr cycle 1 t.datain_src := gdcdi_in; -- data cycle 2 else if (not (t.hit and t.valid)) = '1' then -- $(del) -- write -- writeback | writethrough -- +--------+--------+ -- hit |<MISS> hit | miss -- +----+----+ +----+----+ -- | free|dirty | | -- O5 +--+--+ O4/O6 O6 -- | | -- O5<---O2 -- $(/del) -- if ctrl.allocateonstore = '0' then v.hold := '1'; v.setrep_locked := '1'; v.state := gendc_wb_writedata; t.wbi.fifo_write := '1'; else if t.dirty = '1' then v.hold := '1'; v.state := gendc_wb_wbline; v.state_wbline_next := gendc_wb_writedata; else if (sr_locked = '1') then v.hold := '1'; v.state := gendc_wb_writedata; t.wbi.fifo_write := '1'; else if i.param_r.size = lmd_word then -- note : store is 2 cycle (no reload needed) t.twrite := '1'; t.dwrite := '1'; else v.hold := '1'; v.state := gendc_wb_writedata; end if; end if; end if; end if; else -- $(del) -- write -- writeback | writethrough -- +--------+--------+ -- <HIT>| miss hit | miss -- +----+----+ +----+----+ -- | free|dirty | | -- O5 +--+--+ O4/O6 O6 -- | | -- O5<---O2 -- $(/del) t.setrep := t.set; t.twrite := '1'; t.dwrite := '1'; t.tvalid_src := gdcvalid_old; t.tdirty_src := gdcdirty_add; if i.forcewrite = '1' then v.setrep_locked := '1'; v.hold := '1'; v.state := gendc_wb_writedata; t.wbi.fifo_write := '1'; end if; end if; end if; end if; end if; v.setrep := std_logic_vector(conv_unsigned(t.setrep, lin_log2x(CFG_IC_SETS))); v.dirty := dcmo.tag_line(t.set).dirty; ------------------------------------------------------------------------------- when gendc_wtwb_readdata => -- writethrough and writeback read, load and allocate -- $(del) -- read -- Writeback | Writethrough -- +--------+--------+ -- hit |<MISS> hit |<MISS> -- +----+----+ +----+----+ -- | <free>|<dirty>| | -- O1 +--+--+ O1 O3 -- | | | -- O3<---O2 O4 -- | -- O4 -- $(/del) t.datain_src := gdcdi_me; t.datapi_src := gdcdp_me; t.cmaddr_src := gdca_lo; if r.stored = '0' then t.wbi.fifo_write := '1'; else if wbo.read_finish_v = '1' then t.mexc := wbo.read_mexc; --t.mexc := '1'; if r.setrep_locked = '0' then t.twrite := '1'; t.dwrite := '1'; end if; if i.addrin_re = '1' then v.state := gendc_reloadtaddr; else v.state := gendc_hit; v.hold := '0'; end if; end if; end if; ------------------------------------------------------------------------------- when gendc_wb_writedata => -- writeback-write, allocate, allocate word on subword write -- $(del) -- write -- writeback | Writethrough -- +--------+--------+ -- hit | miss hit | miss -- +----+----+ +----+----+ -- | <FREE>|<DIRTY>| | -- O5 +--+--+ O4/O6 O6 -- | | -- O5<---O2 -- $(/del) -- todo: check for lock on all sets if r.setrep_locked = '1' then t.wbi.fifo_write := '1'; if wbo.fifo_stored_v = '1' then v.hold := '0'; v.state := gendc_hit; end if; else t.twrite := '1'; -- load word of subword allocate if (t.size /= lmd_word) then t.twrite := '0'; t.datain_src := gdcdi_me; t.cmaddr_src := gdca_lo; if r.stored = '0' then t.wbi.fifo_write := '1'; t.size := lmd_word; t.read := '1'; t.lock := '0'; t.datain_src := gdcdi_me; t.datapi_src := gdcdp_me; t.cmaddr_src := gdca_lo; else if wbo.read_finish_v = '1' then t.mexc := wbo.read_mexc; t.twrite := '1'; t.db_src := gdcdb_mem; end if; end if; end if; if (t.twrite = '1') then t.cmaddr_src := gdca_lo; t.datain_src := gdcdi_lo; t.meaddr_src := gdcma_lo; t.twrite := '1'; t.dwrite := '1'; v.hold := '0'; if i.addrin_re = '1' then v.state := gendc_reloadtaddr; else v.state := gendc_hit; v.hold := '0'; end if; end if; end if; ------------------------------------------------------------------------------- when gendc_wt_writedata => -- writethrough-write, no allocate -- $(del) -- write -- writeback | Writethrough -- +--------+--------+ -- hit | miss <HIT>|<MISS> -- +----+----+ +----+----+ -- | free|dirty | | -- O5 +--+--+ O4/O6 O6 -- | | -- O5<---O2 -- $(/del) t.datain_src := gdcdi_lo; t.meaddr_src := gdcma_lo; if r.stored = '0' then v.hold := '1'; t.wbi.fifo_write := '1'; end if; if v.stored = '1' then v.hold := '0'; v.state := gendc_hit; end if; -------------------------------------------------------------------------------
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -