Matched generation of irq1 in Verilog (test.v) and VHDL (test.vhd)

This commit is contained in:
Simon Southwell 2024-03-26 11:19:20 +00:00
commit 30b6ed412a
2 changed files with 4 additions and 15 deletions

View file

@ -49,7 +49,6 @@ reg clk;
integer Count;
integer Seed;
reg nreset_h;
reg irq1;
// ---------------------------------------------------------
// Signals
@ -74,6 +73,7 @@ wire reset_irq = nreset & ~nreset_h;
wire CS1 = (VPAddr[31:28] == 4'ha) ? 1'b1 : 1'b0;
wire CS2 = (VPAddr[31:28] == 4'hb) ? 1'b1 : 1'b0;
wire irq1 = (Count > 54 && Count < 60) ? 1'b1 : 1'b0;
wire [31:0] Interrupt = {30'h0, irq1, nreset};
// ---------------------------------------------------------
@ -130,7 +130,6 @@ begin
// Initialise local state
clk = 1;
Seed = 32'h00250864;
irq1 = 0;
#0 // Ensure first x->1 clock edge is complete before initialisation
Count = 0;
@ -148,18 +147,6 @@ begin
forever #(`CLKPERIOD/2) clk = ~clk;
end
// ---------------------------------------------------------
// ---------------------------------------------------------
always @(posedge clk)
begin
if (Count == 54)
irq1 <= 1'b1;
if (Count == 60)
irq1 <= 1'b0;
end
// ---------------------------------------------------------
// Simulation control and interrupt generation process
// ---------------------------------------------------------

View file

@ -49,6 +49,7 @@ architecture sim of test is
signal notReset_H : std_logic := '0';
signal UpdateResponse : std_logic := '1';
signal irq1 : std_logic := '0';
signal VPAddr , VPDataOut : std_logic_vector(31 downto 0) := 32x"0";
signal VPDataIn : std_logic_vector(31 downto 0) := 32x"0";
@ -66,6 +67,7 @@ begin
---------------------------------------------
notReset <= '1' when (Count > 5) else '0';
CS1 <= '1' when VPAddr(31 downto 28) = 4x"a" else '0';
irq1 <= '1' when (Count > 54) and (Count < 60) else '0';
---------------------------------------------
-- VProc 0
@ -81,7 +83,7 @@ begin
DataIn => VPDataIn,
WRAck => VPWE,
RDAck => VPRD,
Interrupt => 2x"0" & notReset,
Interrupt => '0' & irq1 & notReset,
Update => Update,
UpdateResponse => UpdateResponse,
Node => 4x"0"