K
kb33
Guest
Hi,
If a port is defined as inout in an embedded module (see definition
and assignment below), then how should it be instantiated in the top
level structural module?
In the embedded module:
--------------------------------------
inout [`DATA_SZ-1:0] job_val;
reg [`DATA_SZ-1:0] curr_job_val,
assign job_val = (fsm_state == `SEND_VAL)? curr_job_val :
{`DATA_SZ{1'bz}};
In the top level structural module:
-----------------------------------------------
(When job_val is acting as an input to the embedded module, it gets
its value from the data_in input)
input [`DATA_SZ-1:0] data_in;
wire [`DATA_SZ-1:0] job_val;
job_module job_mod_top (....other I/O signals..
.job_val (data_in),
.
.
);
But this is obviously not working.
Thanks
Kanchan
If a port is defined as inout in an embedded module (see definition
and assignment below), then how should it be instantiated in the top
level structural module?
In the embedded module:
--------------------------------------
inout [`DATA_SZ-1:0] job_val;
reg [`DATA_SZ-1:0] curr_job_val,
assign job_val = (fsm_state == `SEND_VAL)? curr_job_val :
{`DATA_SZ{1'bz}};
In the top level structural module:
-----------------------------------------------
(When job_val is acting as an input to the embedded module, it gets
its value from the data_in input)
input [`DATA_SZ-1:0] data_in;
wire [`DATA_SZ-1:0] job_val;
job_module job_mod_top (....other I/O signals..
.job_val (data_in),
.
.
);
But this is obviously not working.
Thanks
Kanchan