latch for vvp output
This commit is contained in:
parent
35a61b4680
commit
d7736d7eba
|
|
@ -436,6 +436,7 @@ static char* draw_net_input_drive(ivl_nexus_t nex, ivl_nexus_ptr_t nptr)
|
|||
if (lpm) switch (ivl_lpm_type(lpm)) {
|
||||
|
||||
case IVL_LPM_FF:
|
||||
case IVL_LPM_LATCH:
|
||||
case IVL_LPM_ABS:
|
||||
case IVL_LPM_ADD:
|
||||
case IVL_LPM_ARRAY:
|
||||
|
|
|
|||
|
|
@ -1830,6 +1830,31 @@ static void draw_lpm_ff(ivl_lpm_t net)
|
|||
fprintf(vvp_out, ";\n");
|
||||
}
|
||||
|
||||
/*
|
||||
* Emit a LATCH primitive. This uses the following syntax:
|
||||
*
|
||||
* .latch <width> <data>, <enable>;
|
||||
*/
|
||||
static void draw_lpm_latch(ivl_lpm_t net)
|
||||
{
|
||||
ivl_nexus_t nex;
|
||||
|
||||
unsigned width = ivl_lpm_width(net);
|
||||
fprintf(vvp_out, "L_%p .latch %u ", net, width);
|
||||
|
||||
nex = ivl_lpm_data(net,0);
|
||||
assert(nex);
|
||||
fprintf(vvp_out, "%s", draw_net_input(nex));
|
||||
assert(width_of_nexus(nex) == width);
|
||||
|
||||
nex = ivl_lpm_enable(net);
|
||||
assert(nex);
|
||||
assert(width_of_nexus(nex) == 1);
|
||||
fprintf(vvp_out, ", %s", draw_net_input(nex));
|
||||
|
||||
fprintf(vvp_out, ";\n");
|
||||
}
|
||||
|
||||
static void draw_lpm_shiftl(ivl_lpm_t net)
|
||||
{
|
||||
unsigned width = ivl_lpm_width(net);
|
||||
|
|
@ -2160,6 +2185,10 @@ static void draw_lpm_in_scope(ivl_lpm_t net)
|
|||
draw_lpm_ff(net);
|
||||
return;
|
||||
|
||||
case IVL_LPM_LATCH:
|
||||
draw_lpm_latch(net);
|
||||
return;
|
||||
|
||||
case IVL_LPM_CMP_EEQ:
|
||||
case IVL_LPM_CMP_EQ:
|
||||
case IVL_LPM_CMP_EQX:
|
||||
|
|
|
|||
Loading…
Reference in New Issue