Add delays for shifts, concatenation and replication in a CA.
This patch add delays in continuous assignments for the shift operators, concatenations and replications. It also reports an error if the user attempts to take the modulus of a real value. This patch uncovers a couple other problems in the system. I am trying to fix one of them. I will report the other problem shortly.
This commit is contained in:
parent
1609de6ed9
commit
4c5481f254
12
elab_net.cc
12
elab_net.cc
|
|
@ -832,6 +832,12 @@ NetNet* PEBinary::elaborate_net_mod_(Design*des, NetScope*scope,
|
|||
des->errors += 1;
|
||||
}
|
||||
|
||||
if (lsig->data_type() == IVL_VT_REAL) {
|
||||
cerr << get_fileline() << ": error: The modulus operator "
|
||||
"is not supported for real values." << endl;
|
||||
des->errors += 1;
|
||||
}
|
||||
|
||||
ivl_variable_type_t data_type = lsig->data_type();
|
||||
|
||||
/* rwidth is result width. */
|
||||
|
|
@ -1568,8 +1574,7 @@ NetNet* PEConcat::elaborate_net(Design*des, NetScope*scope,
|
|||
}
|
||||
}
|
||||
|
||||
nets[idx] = parms_[idx]->elaborate_net(des, scope, 0,
|
||||
rise,fall,decay);
|
||||
nets[idx] = parms_[idx]->elaborate_net(des, scope, 0, 0, 0, 0);
|
||||
if (nets[idx] == 0)
|
||||
errors += 1;
|
||||
else
|
||||
|
|
@ -1598,6 +1603,9 @@ NetNet* PEConcat::elaborate_net(Design*des, NetScope*scope,
|
|||
vector_width*repeat,
|
||||
nets.count()*repeat);
|
||||
dev->set_line(*this);
|
||||
dev->rise_time(rise);
|
||||
dev->fall_time(fall);
|
||||
dev->decay_time(decay);
|
||||
des->add_node(dev);
|
||||
|
||||
/* Make the temporary signal that connects to all the
|
||||
|
|
|
|||
|
|
@ -1851,13 +1851,14 @@ static void draw_lpm_concat(ivl_lpm_t net)
|
|||
{
|
||||
const char*src_table[4];
|
||||
unsigned icnt = ivl_lpm_selects(net);
|
||||
const char*dly = draw_lpm_output_delay(net);
|
||||
|
||||
if (icnt <= 4) {
|
||||
/* This is the easiest case. There are 4 or fewer input
|
||||
vectors, so the entire IVL_LPM_CONCAT can be
|
||||
implemented with a single .concat node. */
|
||||
draw_lpm_data_inputs(net, 0, icnt, src_table);
|
||||
fprintf(vvp_out, "L_%p .concat ", net);
|
||||
fprintf(vvp_out, "L_%p%s .concat ", net, dly);
|
||||
lpm_concat_inputs(net, 0, icnt, src_table);
|
||||
|
||||
} else {
|
||||
|
|
@ -1943,7 +1944,7 @@ static void draw_lpm_concat(ivl_lpm_t net)
|
|||
|
||||
/* Finally, draw the root node that takes in the final
|
||||
row of tree nodes and generates a single output. */
|
||||
fprintf(vvp_out, "L_%p .concat [", net);
|
||||
fprintf(vvp_out, "L_%p%s .concat [", net, dly);
|
||||
for (idx = 0 ; idx < icnt ; idx += 1)
|
||||
fprintf(vvp_out, " %u", tree[idx].wid);
|
||||
for ( ; idx < 4 ; idx += 1)
|
||||
|
|
@ -2020,11 +2021,13 @@ static void draw_lpm_shiftl(ivl_lpm_t net)
|
|||
{
|
||||
unsigned width = ivl_lpm_width(net);
|
||||
const char* signed_flag = ivl_lpm_signed(net)? "s" : "";
|
||||
const char*dly = draw_lpm_output_delay(net);
|
||||
|
||||
if (ivl_lpm_type(net) == IVL_LPM_SHIFTR)
|
||||
fprintf(vvp_out, "L_%p .shift/r%s %u", net, signed_flag, width);
|
||||
fprintf(vvp_out, "L_%p%s .shift/r%s %u", net, dly, signed_flag,
|
||||
width);
|
||||
else
|
||||
fprintf(vvp_out, "L_%p .shift/l %u", net, width);
|
||||
fprintf(vvp_out, "L_%p%s .shift/l %u", net, dly, width);
|
||||
|
||||
fprintf(vvp_out, ", %s", draw_net_input(ivl_lpm_data(net, 0)));
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue