📄 mt48lc8m16a2.vhd
字号:
MemData1(Bank)(Location) := -1; END IF; END IF; IF (DQML_nwv = '0') THEN IF Violation = '0' THEN MemData0(Bank)(Location) := to_nat(DataIn(7 downto 0)); ELSE MemData0(Bank)(Location) := -1; END IF; END IF; Burst_Cnt(bank) := 1; wrt_in <= '1'; IF (AddressIn(10) = '0') THEN statebank(bank) <= write; ELSIF (AddressIn(10) = '1') THEN statebank(bank) <= write_auto_pre; END IF; written := true; ELSIF (cur_bank = bank) OR (command = mrs) THEN ASSERT false REPORT InstancePath & partID & BankString & ": Illegal command " & "received in active state." SEVERITY SeverityMode; END IF; WHEN write => IF (command = bst) THEN statebank(bank) <= bank_act; Burst_Cnt(bank) := 0; ELSIF (command = read) THEN IF (bank = cur_bank) THEN MemAddr(bank)(8 downto 0) := (others => '0'); --clr old addr MemAddr(bank)(8 downto Burst_Bits) := AddressIn(8 downto Burst_Bits); --latch col addr IF (Burst_Bits > 0) THEN Burst_Inc(bank) := to_nat(AddressIn(Burst_Bits-1 downto 0)); END IF; StartAddr(bank) := Burst_Inc(bank) mod 8; BaseLoc(bank) := to_nat(MemAddr(bank)); Location := BaseLoc(bank) + Burst_Inc(bank); IF MemData1(Bank)(Location) = -2 THEN DataDrive(1) := (others => 'U'); ELSIF MemData1(Bank)(Location) = -1 THEN DataDrive(1) := (others => 'X'); ELSE DataDrive(1) := to_slv(MemData1(Bank)(Location),8); END IF; IF MemData0(Bank)(Location) = -2 THEN DataDrive(0) := (others => 'U'); ELSIF MemData0(Bank)(Location) = -1 THEN DataDrive(0) := (others => 'X'); ELSE DataDrive(0) := to_slv(MemData0(Bank)(Location),8); END IF; Burst_Cnt(bank) := 1; IF (AddressIn(10) = '0') THEN statebank(bank) <= read; ELSIF (AddressIn(10) = '1') THEN statebank(bank) <= read_auto_pre; END IF; ELSE statebank(bank) <= bank_act; END IF; ELSIF (command = writ) THEN IF cur_bank = bank THEN MemAddr(bank)(8 downto 0) := (others => '0'); --clr old addr MemAddr(bank)(8 downto Burst_Bits) := AddressIn(8 downto Burst_Bits); --latch col addr IF (Burst_Bits > 0) THEN Burst_Inc(bank) := to_nat(AddressIn(Burst_Bits-1 downto 0)); END IF; StartAddr(bank) := Burst_Inc(bank) mod 8; BaseLoc(bank) := to_nat(MemAddr(bank)); Location := BaseLoc(bank) + Burst_Inc(bank); IF (DQMU_nwv = '0') THEN IF Violation = '0' THEN MemData1(Bank)(Location) := to_nat(DataIn(15 downto 8)); ELSE MemData1(Bank)(Location) := -1; END IF; END IF; IF (DQML_nwv = '0') THEN IF Violation = '0' THEN MemData0(Bank)(Location) := to_nat(DataIn(7 downto 0)); ELSE MemData0(Bank)(Location) := -1; END IF; END IF; Burst_Cnt(bank) := 1; wrt_in <= '1'; IF (AddressIn(10) = '1') THEN statebank(bank) <= write_auto_pre; END IF; ELSE statebank(bank) <= bank_act; END IF; ELSIF (command = pre) AND ((cur_bank = bank) OR (AddressIn(10) = '1')) THEN ASSERT ras_out(bank) = '1' REPORT InstancePath & partID & BankString & ": precharge command" & " does not meet tRAS time." SEVERITY SeverityMode; ASSERT (DQML_nwv = '1' AND DQMU_nwv = '1') REPORT InstancePath & partID & BankString & ": DQMs should be" & " held high, data is lost." SEVERITY SeverityMode; statebank(bank) <= precharge, idle AFTER tdevice_TRP; ELSIF (command = nop) OR (cur_bank /= bank) THEN IF (Burst_Cnt(bank) = Burst_Length OR WB = single) THEN statebank(bank) <= bank_act; Burst_Cnt(bank) := 0; ras_in(bank) <= '1'; ELSE IF (Burst = sequential) THEN Burst_Inc(bank) := (Burst_Inc(bank) + 1) MOD Burst_Length; ELSE Burst_Inc(bank) := intab(StartAddr(bank)) (Burst_Cnt(bank)); END IF; Location := BaseLoc(bank) + Burst_Inc(bank); IF (DQMU_nwv = '0') THEN IF Violation = '0' THEN MemData1(Bank)(Location) := to_nat(DataIn(15 downto 8)); ELSE MemData1(Bank)(Location) := -1; END IF; END IF; IF (DQML_nwv = '0') THEN IF Violation = '0' THEN MemData0(Bank)(Location) := to_nat(DataIn(7 downto 0)); ELSE MemData0(Bank)(Location) := -1; END IF; END IF; Burst_Cnt(bank) := Burst_Cnt(bank) + 1; wrt_in <= '1'; END IF; ELSIF cur_bank = bank THEN ASSERT false REPORT InstancePath & partID & ": Illegal command" & " received in write state." SEVERITY SeverityMode; END IF; WHEN read => IF (command = bst) THEN statebank(bank) <= bank_act; Burst_Cnt(bank) := 0; ELSIF (command = read) THEN IF cur_bank = bank THEN MemAddr(bank)(8 downto 0) := (others => '0'); --clr old addr MemAddr(bank)(8 downto Burst_Bits) := AddressIn(8 downto Burst_Bits); --latch col addr IF (Burst_Bits > 0) THEN Burst_Inc(bank) := to_nat(AddressIn(Burst_Bits-1 downto 0)); END IF; StartAddr(bank) := Burst_Inc(bank) mod 8; BaseLoc(bank) := to_nat(MemAddr(bank)); Location := BaseLoc(bank) + Burst_Inc(bank); IF MemData1(Bank)(Location) = -2 THEN DataDrive(1) := (others => 'U'); ELSIF MemData1(Bank)(Location) = -1 THEN DataDrive(1) := (others => 'X'); ELSE DataDrive(1) := to_slv(MemData1(Bank)(Location),8); END IF; IF MemData0(Bank)(Location) = -2 THEN DataDrive(0) := (others => 'U'); ELSIF MemData0(Bank)(Location) = -1 THEN DataDrive(0) := (others => 'X'); ELSE DataDrive(0) := to_slv(MemData0(Bank)(Location),8); END IF; Burst_Cnt(bank) := 1; IF (AddressIn(10) = '0') THEN statebank(bank) <= read; ELSIF (AddressIn(10) = '1') THEN statebank(bank) <= read_auto_pre; END IF; ELSE statebank(bank) <= bank_act; END IF; ELSIF (command = writ) THEN IF cur_bank = bank THEN ASSERT rcdt_out(bank) = '0' REPORT InstancePath & partID & BankString & ": write command" & " received too soon after active." SEVERITY SeverityMode; ASSERT ((AddressIn(10) = '0') OR (AddressIn(10) = '1')) REPORT InstancePath & partID & BankString & ": AddressIn(10) = X" & " during write command. Next state unknown." SEVERITY SeverityMode; MemAddr(bank)(8 downto 0) := (others => '0'); --clr old addr MemAddr(bank)(8 downto Burst_Bits) := AddressIn(8 downto Burst_Bits); --latch col addr IF (Burst_Bits > 0) THEN Burst_Inc(bank) := to_nat(AddressIn(Burst_Bits-1 downto 0)); END IF; StartAddr(bank) := Burst_Inc(bank) mod 8; BaseLoc(bank) := to_nat(MemAddr(bank)); Location := BaseLoc(bank) + Burst_Inc(bank); IF (DQMU_nwv = '0') THEN IF Violation = '0' THEN MemData1(Bank)(Location) := to_nat(DataIn(15 downto 8)); ELSE MemData1(Bank)(Location) := -1; END IF; END IF; IF (DQML_nwv = '0') THEN IF Violation = '0' THEN MemData0(Bank)(Location) := to_nat(DataIn(7 downto 0)); ELSE MemData0(Bank)(Location) := -1; END IF; END IF; Burst_Cnt(bank) := 1; wrt_in <= '1'; IF (AddressIn(10) = '0') THEN statebank(bank) <= write; ELSIF (AddressIn(10) = '1') THEN statebank(bank) <= write_auto_pre; END IF; ELSE statebank(bank) <= bank_act; END IF; ELSIF (command = pre) AND ((cur_bank = bank) OR (AddressIn(10) = '1')) THEN statebank(bank) <= precharge, idle AFTER tdevice_TRP; ASSERT ras_out(bank) = '1' REPORT InstancePath & partID & BankString & ": precharge command" & " does not meet tRAS time." SEVERITY SeverityMode; ELSIF (command = nop) OR (cur_bank /= bank) THEN IF (Burst_Cnt(bank) = Burst_Length) THEN statebank(bank) <= bank_act; Burst_Cnt(bank) := 0; ras_in(bank) <= '1'; ELSE IF (Burst = sequential) THEN Burst_Inc(bank) := (Burst_Inc(bank) + 1) MOD Burst_Length; ELSE Burst_Inc(bank) := intab(StartAddr(bank)) (Burst_Cnt(bank)); END IF; Location := BaseLoc(bank) + Burst_Inc(bank); IF MemData1(Bank)(Location) = -2 THEN DataDrive(1) := (others => 'U'); ELSIF MemData1(Bank)(Location) = -1 THEN DataDrive(1) := (others => 'X'); ELSE DataDrive(1) := to_slv(MemData1(Bank)(Location),8); END IF; IF MemData0(Bank)(Location) = -2 THEN DataDrive(0) := (others => 'U'); ELSIF MemData0(Bank)(Location) = -1 THEN DataDrive(0) := (others => 'X');
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -