📄 cachemem.vhd
字号:
end loop; itdatain <= vitdatain; iddatain <= viddatain; dtdatain <= vdtdatain; dtdatain2 <= vdtdatain2; dtdatain3 <= vdtdatain3; dtdatainu <= vdtdatainu; dddatain <= vdddatain; end process; itwrite <= crami.icramin.twrite; idwrite <= crami.icramin.dwrite; itenable <= crami.icramin.tenable; idenable <= crami.icramin.denable; dtaddr <= crami.dcramin.address(DOFFSET_BITS + DLINE_BITS -1 downto DLINE_BITS); dtaddr2 <= crami.dcramin.saddress(DOFFSET_BITS-1 downto 0); ddaddr <= crami.dcramin.address(DOFFSET_BITS + DLINE_BITS -1 downto 0); ldaddr <= crami.dcramin.ldramin.address(DLRAM_BITS-1 downto 2); dtwrite <= crami.dcramin.twrite; dtwrite2 <= crami.dcramin.swrite; dtwrite3 <= crami.dcramin.tpwrite; ddwrite <= crami.dcramin.dwrite; dtenable <= crami.dcramin.tenable; dtenable2 <= crami.dcramin.senable; ddenable <= crami.dcramin.denable; ime : if icen = 1 generate im0 : for i in 0 to ISETS-1 generate itags0 : syncram generic map (tech, IOFFSET_BITS, ITWIDTH) port map ( clk, itaddr, itdatain(i)(ITWIDTH-1 downto 0), itdataout(i)(ITWIDTH-1 downto 0), itenable, itwrite(i)); idata0 : syncram generic map (tech, IOFFSET_BITS+ILINE_BITS, IDWIDTH) port map (clk, idaddr, iddatain, iddataout(i), idenable, idwrite(i)); end generate; ind0 : for i in ISETS to MAXSETS-1 generate itdataout(i) <= (others => '0'); iddataout(i) <= (others => '0'); end generate; end generate; imd : if icen = 0 generate ind0 : for i in 0 to ISETS-1 generate itdataout(i) <= (others => '0'); iddataout(i) <= (others => '0'); end generate; end generate; ild0 : if ilram = 1 generate ildata0 : syncram generic map (tech, ILRAM_BITS-2, 32) port map (clk, ildaddr, iddatain, ildataout, crami.icramin.ldramin.enable, crami.icramin.ldramin.write); end generate; dme : if dcen = 1 generate dtags0 : if DSNOOP = 0 generate dt0 : for i in 0 to DSETS-1 generate dtags0 : syncram generic map (tech, DOFFSET_BITS, DTWIDTH) port map (clk, dtaddr, dtdatain(i)(DTWIDTH-1 downto 0), dtdataout(i)(DTWIDTH-1 downto 0), dtenable(i), dtwrite(i)); end generate; end generate; dtags1 : if DSNOOP /= 0 generate dt1 : if ((MMUEN = 0) or not DSNOOPMMU) generate dt0 : for i in 0 to DSETS-1 generate dtags0 : syncram_dp generic map (tech, DOFFSET_BITS, DTWIDTH) port map ( clk, dtaddr, dtdatain(i)(DTWIDTH-1 downto 0), dtdataout(i)(DTWIDTH-1 downto 0), dtenable(i), dtwrite(i), sclk, dtaddr2, dtdatain2(i)(DTWIDTH-1 downto 0), dtdataout2(i)(DTWIDTH-1 downto 0), dtenable2(i), dtwrite2(i)); end generate; end generate; mdt1 : if not ((MMUEN = 0) or not DSNOOPMMU) generate dt0 : for i in 0 to DSETS-1 generate dtags0 : syncram_dp generic map (tech, DOFFSET_BITS, DTWIDTH) port map ( clk, dtaddr, dtdatain(i)(DTWIDTH-1 downto 0), dtdataout(i)(DTWIDTH-1 downto 0), dtenable(i), dtwrite(i), sclk, dtaddr2, dtdatain2(i)(DTWIDTH-1 downto 0), dtdataout2(i)(DTWIDTH-1 downto 0), dtenable2(i), dtwrite2(i)); dtags1 : syncram_dp generic map (tech, DOFFSET_BITS, DPTAG_BITS) port map ( clk, dtaddr, dtdatain3(i)(DTAG_BITS-1 downto DTAG_BITS-DPTAG_BITS), open, dtwrite3(i), dtwrite3(i), sclk, dtaddr2, dtdatainu(i)(DTAG_BITS-1 downto DTAG_BITS-DPTAG_BITS), dtdataout3(i)(DTAG_BITS-1 downto DTAG_BITS-DPTAG_BITS), dtenable2(i), dtwrite2(i)); end generate; end generate; end generate; nodtags1 : if DSNOOP = 0 generate dt0 : for i in 0 to DSETS-1 generate dtdataout2(i)(DTWIDTH-1 downto 0) <= zero64(DTWIDTH-1 downto 0); dtdataout3(i)(DTWIDTH-1 downto 0) <= zero64(DTWIDTH-1 downto 0); end generate; end generate; dd0 : for i in 0 to DSETS-1 generate ddata0 : syncram generic map (tech, DOFFSET_BITS+DLINE_BITS, DDWIDTH) port map (clk, ddaddr, dddatain(i), dddataout(i), ddenable(i), ddwrite(i)); end generate; dnd0 : for i in DSETS to MAXSETS-1 generate dtdataout(i) <= (others => '0'); dtdataout2(i) <= (others => '0'); dtdataout3(i) <= (others => '0'); dddataout(i) <= (others => '0'); end generate; end generate; dmd : if dcen = 0 generate dnd0 : for i in 0 to DSETS-1 generate dtdataout(i) <= (others => '0'); dtdataout2(i) <= (others => '0'); dtdataout3(i) <= (others => '0'); dddataout(i) <= (others => '0'); end generate; end generate; ldxs0 : if not ((dlram = 1) and (DSETS > 1)) generate lddatain <= dddatain(0); end generate; ldxs1 : if (dlram = 1) and (DSETS > 1) generate lddatain <= dddatain(1); end generate; ld0 : if dlram = 1 generate ldata0 : syncram generic map (tech, DLRAM_BITS-2, 32) port map (clk, ldaddr, lddatain, ldataout, crami.dcramin.ldramin.enable, crami.dcramin.ldramin.write); end generate; itx : for i in 0 to ISETS-1 generate cramo.icramo.tag(i)(TAG_HIGH downto ITAG_LOW) <= itdataout(i)(ITAG_BITS-1 downto (ITAG_BITS-1) - (TAG_HIGH - ITAG_LOW)); --(ITWIDTH-1-(ILRR_BIT+ICLOCK_BIT) downto ITWIDTH-(TAG_HIGH-ITAG_LOW)-(ILRR_BIT+ICLOCK_BIT)-1); cramo.icramo.tag(i)(ilinesize-1 downto 0) <= itdataout(i)(ilinesize-1 downto 0); cramo.icramo.tag(i)(CTAG_LRRPOS) <= itdataout(i)(ITWIDTH - (1+ICLOCK_BIT)); cramo.icramo.tag(i)(CTAG_LOCKPOS) <= itdataout(i)(ITWIDTH-1); ictx : if mmuen = 1 generate cramo.icramo.ctx(i) <= itdataout(i)((ITWIDTH - (ILRR_BIT+ICLOCK_BIT+1)) downto (ITWIDTH - (ILRR_BIT+ICLOCK_BIT+M_CTX_SZ))); end generate; cramo.icramo.data(i) <= ildataout when (ilram = 1) and ((ISETS = 1) or (i = 1)) and (crami.icramin.ldramin.read = '1') else iddataout(i)(31 downto 0); itv : if ilinesize = 4 generate cramo.icramo.tag(i)(7 downto 4) <= (others => '0'); end generate; ite : for j in 10 to ITAG_LOW-1 generate cramo.icramo.tag(i)(j) <= '0'; end generate; end generate; itx2 : for i in ISETS to MAXSETS-1 generate cramo.icramo.tag(i) <= (others => '0'); cramo.icramo.data(i) <= (others => '0'); end generate; itd : for i in 0 to DSETS-1 generate cramo.dcramo.tag(i)(TAG_HIGH downto DTAG_LOW) <= dtdataout(i)(DTAG_BITS-1 downto (DTAG_BITS-1) - (TAG_HIGH - DTAG_LOW)); --(DTWIDTH-1-(DLRR_BIT+DCLOCK_BIT) downto DTWIDTH-(TAG_HIGH-DTAG_LOW)-(DLRR_BIT+DCLOCK_BIT)-1); --cramo.dcramo.tag(i)(TAG_HIGH downto DTAG_LOW) <= dtdataout(i)(DTWIDTH-1-(DLRR_BIT+DCLOCK_BIT) downto DTWIDTH-(TAG_HIGH-DTAG_LOW)-(DLRR_BIT+DCLOCK_BIT)-1); cramo.dcramo.tag(i)(dlinesize-1 downto 0) <= dtdataout(i)(dlinesize-1 downto 0); cramo.dcramo.tag(i)(CTAG_LRRPOS) <= dtdataout(i)(DTWIDTH - (1+DCLOCK_BIT)); cramo.dcramo.tag(i)(CTAG_LOCKPOS) <= dtdataout(i)(DTWIDTH-1); ictx : if mmuen /= 0 generate cramo.dcramo.ctx(i) <= dtdataout(i)((DTWIDTH - (DLRR_BIT+DCLOCK_BIT+1)) downto (DTWIDTH - (DLRR_BIT+DCLOCK_BIT+M_CTX_SZ))); end generate; stagv : if not ((MMUEN = 0) or not DSNOOPMMU) generate cramo.dcramo.stag(i)(TAG_HIGH downto DTAG_LOW) <= dtdataout3(i)(DTAG_BITS-1 downto (DTAG_BITS-1) - (TAG_HIGH - DTAG_LOW)); end generate; stagp : if ((MMUEN = 0) or not DSNOOPMMU) generate cramo.dcramo.stag(i)(TAG_HIGH downto DTAG_LOW) <= dtdataout2(i)(DTAG_BITS-1 downto (DTAG_BITS-1) - (TAG_HIGH - DTAG_LOW)); end generate; -- cramo.dcramo.stag(i)(TAG_HIGH downto DTAG_LOW) <= dtdataout2(i)(DTWIDTH-1 downto DTWIDTH-(TAG_HIGH-DTAG_LOW)-1); cramo.dcramo.stag(i)(dlinesize-1 downto 0) <= dtdataout2(i)(dlinesize-1 downto 0); cramo.dcramo.stag(i)(CTAG_LRRPOS) <= dtdataout2(i)(DTWIDTH - (1+DCLOCK_BIT)); cramo.dcramo.stag(i)(CTAG_LOCKPOS) <= dtdataout2(i)(DTWIDTH-1); cramo.dcramo.data(i) <= ldataout when (dlram = 1) and ((DSETS = 1) or (i = 1)) and (crami.dcramin.ldramin.read = '1') else dddataout(i)(31 downto 0); dtv : if dlinesize = 4 generate cramo.dcramo.tag(i)(7 downto 4) <= (others => '0'); cramo.dcramo.stag(i)(7 downto 4) <= (others => '0'); end generate; dte : for j in 10 to DTAG_LOW-1 generate cramo.dcramo.tag(i)(j) <= '0'; cramo.dcramo.stag(i)(j) <= '0'; end generate; end generate; itd2 : for i in DSETS to MAXSETS-1 generate cramo.dcramo.tag(i) <= (others => '0'); cramo.dcramo.stag(i) <= (others => '0'); cramo.dcramo.data(i) <= (others => '0'); end generate; nodrv : for i in 0 to MAXSETS-1 generate cramo.dcramo.tpar(i) <= (others => '0'); cramo.dcramo.dpar(i) <= (others => '0'); cramo.dcramo.spar(i) <= '0'; cramo.icramo.tpar(i) <= (others => '0'); cramo.icramo.dpar(i) <= (others => '0'); nommu : if mmuen = 0 generate cramo.icramo.ctx(i) <= (others => '0'); cramo.dcramo.ctx(i) <= (others => '0'); end generate; end generate;end ;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -