projectx100
Newbie level 3
- Joined
- Aug 6, 2013
- Messages
- 3
- Helped
- 0
- Reputation
- 0
- Reaction score
- 0
- Trophy points
- 1
- Activity points
- 21
Howdy all,
1. Can I use a genvar value for a comparison with vector bit signal rather than just accessing the specific bit in a vector.
Example: vector_sig == j
where j is a genvar and vector_sig is wire [10:0].
If not, how can I generate multiple blocks and still have a reference to the index value of the block I created.
Code example:
2. Can I declare and assign a signal in the same line?
Example: wire my_sig = a & b;
Thanks in advance,
Nad.
1. Can I use a genvar value for a comparison with vector bit signal rather than just accessing the specific bit in a vector.
Example: vector_sig == j
where j is a genvar and vector_sig is wire [10:0].
If not, how can I generate multiple blocks and still have a reference to the index value of the block I created.
Code example:
Code:
genvar j;
generate
for (j=0;j<SRC_DEST_PAIR_NUM;j=j+1)
begin: conversion
assign net_addr_to_counter_id_val[j] = j;
assign net_addr_to_counter_id_ns[j] = (prediction_result_src_dest == net_addr_to_counter_id_val[j]) ? first_free_counter_id : net_addr_to_counter_id[j];
registerN #(LG_NUM_PREDICTIONS, 'd0) counter_id_ff(
.clk(clk),
.reset(reset),
.en(),
.ns(net_addr_to_counter_id_ns[j]),
.ps(net_addr_to_counter_id[j])
);
end
endgenerate
2. Can I declare and assign a signal in the same line?
Example: wire my_sig = a & b;
Thanks in advance,
Nad.