Search code examples
specman

Specman - Error: Cannot access null port expression


I have a monitor unit with the following fields/events: uart_env.e:

unit uart_monitor_u like uvm_monitor{
   smp : uart_signal_map_u; //ptr to smp
   keep smp  == get_enclosing_unit(uart_env_u).smp;
   kind : uart_monitor_u_kind_t; 

};

uart_monitor.e:

extend uart_monitor_u{
   !port_data_b : inout simple_port of bit; -- pointer to the data-bit port
   event clk_e is rise (smp.port_uart_clk$) @sim;
   event data_deassert is fall (port_data_b$) @uart_clk_e;
   .......
   .......
};

uart_rx_monitor.e:

extend RX uart_monitor_u{
   keep soft port_data_b == smp.port_rxdi;
   .....
   .....
};

uart_types.e:

type uart_monitor_u_kind_t: [ RX, TX ];

uart_signal_map.e:

extend uart_signal_map_u {

    p_def port_uart_clk           bit;
    p_def port_uart_clk_period    real;
    p_def port_resetn             bit;

    p_def port_br_clk_period      real;
    p_def port_uart_int           bit;  
    p_def port_txdo               bit;   

    p_def port_rxdi               bit;
    ......
    ...... 
};

The order of the compilation of the relevant file:

import uart_types;
import uart_env;
import uart_monitor;
import uart_rx_monitor;

For some reason I got the following error when I try to compile: *** Error: Cannot access null port expression. at line 22 in @uart_monitor event data_deassert is fall (port_data_b$) @uart_clk_e;


Solution

  • the port_data_b pointer is marked as do-not-generate. so it remains NULL. try removing the "!" from it