idt71v3556.vhd
来自「VHDL的ram和fifo model code 包含众多的厂家」· VHDL 代码 · 共 1,403 行 · 第 1/5 页
VHD
1,403 行
END IF; WHEN write => state <= begin_wr; MemAddr := to_nat(AddressIn); startaddr := MemAddr; memstart := to_nat(AddressIn(1 downto 0)); OBuf1 := (others => 'Z'); BWA1 := BWANIn; BWB1 := BWBNIn; BWC1 := BWCNIn; BWD1 := BWDNIn; wr1 := true; WHEN burst => state <= burst_rd; Burst_Cnt := Burst_Cnt + 1; IF (Burst_Cnt = 4) THEN Burst_Cnt := 0; END IF; offset := Burst_Seq(memstart)(Burst_Cnt); MemAddr := startaddr + offset; IF MemDataA(MemAddr) = -2 THEN OBuf1(8 downto 0) := (others => 'U'); ELSIF MemDataA(MemAddr) = -1 THEN OBuf1(8 downto 0) := (others => 'X'); ELSE OBuf1(8 downto 0) := to_slv(MemDataA(MemAddr),9); END IF; IF MemDataB(MemAddr) = -2 THEN OBuf1(17 downto 9) := (others => 'U'); ELSIF MemDataB(MemAddr) = -1 THEN OBuf1(17 downto 9) := (others => 'X'); ELSE OBuf1(17 downto 9) := to_slv(MemDataB(MemAddr),9); END IF; IF MemDataC(MemAddr) = -2 THEN OBuf1(26 downto 18) := (others => 'U'); ELSIF MemDataC(MemAddr) = -1 THEN OBuf1(26 downto 18) := (others => 'X'); ELSE OBuf1(26 downto 18) := to_slv(MemDataC(MemAddr),9); END IF; IF MemDataD(MemAddr) = -2 THEN OBuf1(35 downto 27) := (others => 'U'); ELSIF MemDataD(MemAddr) = -1 THEN OBuf1(35 downto 27) := (others => 'X'); ELSE OBuf1(35 downto 27) := to_slv(MemDataD(MemAddr),9); END IF; END CASE; WHEN begin_wr => BWA2 := BWA1; BWB2 := BWB1; BWC2 := BWC1; BWD2 := BWD1; Burst_Cnt := 0; CASE command IS WHEN ds => state <= desel; OBuf1 := (others => 'Z'); WHEN read => state <= begin_rd; MemAddr := to_nat(AddressIn); startaddr := MemAddr; memstart := to_nat(AddressIn(1 downto 0)); IF MemDataA(MemAddr) = -2 THEN OBuf1(8 downto 0) := (others => 'U'); ELSIF MemDataA(MemAddr) = -1 THEN OBuf1(8 downto 0) := (others => 'X'); ELSE OBuf1(8 downto 0) := to_slv(MemDataA(MemAddr),9); END IF; IF MemDataB(MemAddr) = -2 THEN OBuf1(17 downto 9) := (others => 'U'); ELSIF MemDataB(MemAddr) = -1 THEN OBuf1(17 downto 9) := (others => 'X'); ELSE OBuf1(17 downto 9) := to_slv(MemDataB(MemAddr),9); END IF; IF MemDataC(MemAddr) = -2 THEN OBuf1(26 downto 18) := (others => 'U'); ELSIF MemDataC(MemAddr) = -1 THEN OBuf1(26 downto 18) := (others => 'X'); ELSE OBuf1(26 downto 18) := to_slv(MemDataC(MemAddr),9); END IF; IF MemDataD(MemAddr) = -2 THEN OBuf1(35 downto 27) := (others => 'U'); ELSIF MemDataD(MemAddr) = -1 THEN OBuf1(35 downto 27) := (others => 'X'); ELSE OBuf1(35 downto 27) := to_slv(MemDataD(MemAddr),9); END IF; WHEN write => state <= begin_wr; MemAddr := to_nat(AddressIn); startaddr := MemAddr; OBuf1 := (others => 'Z'); BWA1 := BWANIn; BWB1 := BWBNIn; BWC1 := BWCNIn; BWD1 := BWDNIn; wr1 := true; WHEN burst => state <= burst_wr; Burst_Cnt := Burst_Cnt + 1; IF (Burst_Cnt = 4) THEN Burst_Cnt := 0; END IF; offset := Burst_Seq(memstart)(Burst_Cnt); MemAddr := startaddr + offset; BWA1 := BWANIn; BWB1 := BWBNIn; BWC1 := BWCNIn; BWD1 := BWDNIn; wr1 := true; END CASE; WHEN burst_rd => CASE command IS WHEN ds => state <= desel; OBuf1 := (others => 'Z'); WHEN read => state <= begin_rd; MemAddr := to_nat(AddressIn); startaddr := MemAddr; memstart := to_nat(AddressIn(1 downto 0)); IF MemDataA(MemAddr) = -2 THEN OBuf1(8 downto 0) := (others => 'U'); ELSIF MemDataA(MemAddr) = -1 THEN OBuf1(8 downto 0) := (others => 'X'); ELSE OBuf1(8 downto 0) := to_slv(MemDataA(MemAddr),9); END IF; IF MemDataB(MemAddr) = -2 THEN OBuf1(17 downto 9) := (others => 'U'); ELSIF MemDataB(MemAddr) = -1 THEN OBuf1(17 downto 9) := (others => 'X'); ELSE OBuf1(17 downto 9) := to_slv(MemDataB(MemAddr),9); END IF; IF MemDataC(MemAddr) = -2 THEN OBuf1(26 downto 18) := (others => 'U'); ELSIF MemDataC(MemAddr) = -1 THEN OBuf1(26 downto 18) := (others => 'X'); ELSE OBuf1(26 downto 18) := to_slv(MemDataC(MemAddr),9); END IF; IF MemDataD(MemAddr) = -2 THEN OBuf1(35 downto 27) := (others => 'U'); ELSIF MemDataD(MemAddr) = -1 THEN OBuf1(35 downto 27) := (others => 'X'); ELSE OBuf1(35 downto 27) := to_slv(MemDataD(MemAddr),9); END IF; WHEN write => state <= begin_wr; MemAddr := to_nat(AddressIn); startaddr := MemAddr; memstart := to_nat(AddressIn(1 downto 0)); OBuf1 := (others => 'Z'); BWA1 := BWANIn; BWB1 := BWBNIn; BWC1 := BWCNIn; BWD1 := BWDNIn; wr1 := true; WHEN burst => Burst_Cnt := Burst_Cnt + 1; IF (Burst_Cnt = 4) THEN Burst_Cnt := 0; END IF; offset := Burst_Seq(memstart)(Burst_Cnt); MemAddr := startaddr + offset; IF MemDataA(MemAddr) = -2 THEN OBuf1(8 downto 0) := (others => 'U'); ELSIF MemDataA(MemAddr) = -1 THEN OBuf1(8 downto 0) := (others => 'X'); ELSE OBuf1(8 downto 0) := to_slv(MemDataA(MemAddr),9); END IF; IF MemDataB(MemAddr) = -2 THEN OBuf1(17 downto 9) := (others => 'U'); ELSIF MemDataB(MemAddr) = -1 THEN OBuf1(17 downto 9) := (others => 'X'); ELSE OBuf1(17 downto 9) := to_slv(MemDataB(MemAddr),9); END IF; IF MemDataC(MemAddr) = -2 THEN OBuf1(26 downto 18) := (others => 'U'); ELSIF MemDataC(MemAddr) = -1 THEN OBuf1(26 downto 18) := (others => 'X'); ELSE OBuf1(26 downto 18) := to_slv(MemDataC(MemAddr),9); END IF; IF MemDataD(MemAddr) = -2 THEN OBuf1(35 downto 27) := (others => 'U'); ELSIF MemDataD(MemAddr) = -1 THEN OBuf1(35 downto 27) := (others => 'X'); ELSE OBuf1(35 downto 27) := to_slv(MemDataD(MemAddr),9); END IF; END CASE; WHEN burst_wr => CASE command IS WHEN ds => state <= desel; OBuf1 := (others => 'Z'); WHEN read => state <= begin_rd; MemAddr := to_nat(AddressIn); startaddr := MemAddr; memstart := to_nat(AddressIn(1 downto 0)); IF MemDataA(MemAddr) = -2 THEN OBuf1(8 downto 0) := (others => 'U'); ELSIF MemDataA(MemAddr) = -1 THEN OBuf1(8 downto 0) := (others => 'X'); ELSE OBuf1(8 downto 0) := to_slv(MemDataA(MemAddr),9); END IF; IF MemDataB(MemAddr) = -2 THEN OBuf1(17 downto 9) := (others => 'U'); ELSIF MemDataB(MemAddr) = -1 THEN OBuf1(17 downto 9) := (others => 'X'); ELSE OBuf1(17 downto 9) := to_slv(MemDataB(MemAddr),9); END IF; IF MemDataC(MemAddr) = -2 THEN OBuf1(26 downto 18) := (others => 'U'); ELSIF MemDataC(MemAddr) = -1 THEN OBuf1(26 downto 18) := (others => 'X'); ELSE OBuf1(26 downto 18) := to_slv(MemDataC(MemAddr),9); END IF; IF MemDataD(MemAddr) = -2 THEN OBuf1(35 downto 27) := (others => 'U'); ELSIF MemDataD(MemAddr) = -1 THEN OBuf1(35 downto 27) := (others => 'X'); ELSE OBuf1(35 downto 27) := to_slv(MemDataD(MemAddr),9); END IF; WHEN write => state <= begin_wr; MemAddr := to_nat(AddressIn); startaddr := MemAddr; memstart := to_nat(AddressIn(1 downto 0)); OBuf1 := (others => 'Z'); BWA1 := BWANIn; BWB1 := BWBNIn; BWC1 := BWCNIn; BWD1 := BWDNIn; wr1 := true; WHEN burst => Burst_Cnt := Burst_Cnt + 1; IF (Burst_Cnt = 4) THEN Burst_Cnt := 0; END IF; offset := Burst_Seq(memstart)(Burst_Cnt); MemAddr := startaddr + offset; BWA1 := BWANIn; BWB1 := BWBNIn; BWC1 := BWCNIn; BWD1 := BWDNIn; wr1 := true; END CASE; END CASE; IF (OENegIn = '0') THEN D_zd <= (others => 'Z'), OBuf2 AFTER 1 ns; END IF; END IF; -------------------------------------------------------------------- -- File Read Section -------------------------------------------------------------------- -- Reads hex data from file. Three characters per
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?