In reply to rajan passionate:
Hi dave,
I am facing new issue now after running the simulation(after run -all)
** Fatal: (SIGSEGV) Bad handle or reference.
Time: 606 ns Iteration: 0 Process: /top/i2c_assert/#ALWAYS#25 File: …/ref/i2c_assertions.sv
Fatal error in Module i2c_assertions at …/ref/i2c_assertions.sv line 28
HDL call sequence:
Stopped at …/ref/i2c_assertions.sv 28 Module i2c_assertions
Here is my new partial assertion module code
import CONFIG::*;
module i2c_assertions(i2c_if I2C_INTERFACE);
tri1 sda;
bit slave_addr_tran;
bit mem_addr_tran;
bit data_tran_WR;
bit data_tran_RD;
//(.sda(sda));
i2c_config cfg;
always @(posedge I2C_INTERFACE.scl)
begin
slave_addr_tran = cfg.slave_addr_tran;
mem_addr_tran = cfg.mem_addr_tran;
data_tran_WR = cfg.data_tran_WR;
data_tran_RD = cfg.data_tran_RD;
end
//TOP module code
include "apb_env.sv"
include “i2c_env.sv”
import CONFIG::*;
module top;
parameter CLOCK=5ns;
logic PCLK;
tri1 sda;
logic scl0_o,scl0_oen,sda0_oen,sda0_o;
//INTERFACE INSTANCE
APB_INT APBINT(.PCLK(PCLK));
i2c_if I2C_INT(.sda(sda));
//Assertion block Instance
i2c_assertions i2c_assert(.I2C_INTERFACE(I2C_INT));//.I2C_INTERFACE(I2C_INT));
–>Here I am using interface as the port in assertion module and calling using that port in top.When I do like this I am getting the above error.
–>Where as If I do like below I am not getting any errors but no effect of assertions will be seen.
//Here is my new partial assertion module code
import CONFIG::*;
module i2c_assertions();
tri1 sda;
bit slave_addr_tran;
bit mem_addr_tran;
bit data_tran_WR;
bit data_tran_RD;
//(.sda(sda));
i2c_if I2C_INTERFACE(.sda(sda));
i2c_config cfg;
always @(posedge I2C_INTERFACE.scl)
begin
slave_addr_tran = cfg.slave_addr_tran;
mem_addr_tran = cfg.mem_addr_tran;
data_tran_WR = cfg.data_tran_WR;
data_tran_RD = cfg.data_tran_RD;
end
//TOP module code
include "apb_env.sv"
include “i2c_env.sv”
import CONFIG::*;
module top;
parameter CLOCK=5ns;
logic PCLK;
tri1 sda;
logic scl0_o,scl0_oen,sda0_oen,sda0_o;
//INTERFACE INSTANCE
APB_INT APBINT(.PCLK(PCLK));
i2c_if I2C_INT(.sda(sda));
//Assertion block Instance
i2c_assertions i2c_assert();//.I2C_INTERFACE(I2C_INT));