From 30b6ed412ac164274b53c8a6dceb18b04ae1ff66 Mon Sep 17 00:00:00 2001 From: Simon Southwell Date: Tue, 26 Mar 2024 11:19:20 +0000 Subject: [PATCH] Matched generation of irq1 in Verilog (test.v) and VHDL (test.vhd) --- python/test/test.v | 15 +-------------- python/test/test.vhd | 4 +++- 2 files changed, 4 insertions(+), 15 deletions(-) diff --git a/python/test/test.v b/python/test/test.v index 34746e7..ffaefd2 100644 --- a/python/test/test.v +++ b/python/test/test.v @@ -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 // --------------------------------------------------------- diff --git a/python/test/test.vhd b/python/test/test.vhd index fe9f9ea..70d1dcf 100644 --- a/python/test/test.vhd +++ b/python/test/test.vhd @@ -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"