-
Notifications
You must be signed in to change notification settings - Fork 1k
Open
Description
I found that in the reset logic of the controller.sv module, the assignment to the register array is done using a scalar value. However, this results in an error during compilation with Quartus II 18.1.
So I rewrote the code in the following form:
always @(posedge clk) begin
if (reset) begin
mem_read_valid <= 0;
mem_read_address <= {`NUM_CHANNELS{`ADDR_BITS'd0}};
mem_write_valid <= 0;
mem_write_address <= {`NUM_CHANNELS{`ADDR_BITS'd0}};
mem_write_data <= {`NUM_CHANNELS{`DATA_BITS'd0}};
consumer_read_ready <= 0;
consumer_read_data <= {`NUM_CHANNELS{`DATA_BITS'd0}};
consumer_write_ready <= 0;
current_consumer <= {`NUM_CHANNELS{`CONSUMER_INDEX_WIDTH'd0}}; // parameter CONSUMER_INDEX_WIDTH = $clog2(NUM_CONSUMERS)
controller_state <= {`NUM_CHANNELS{3'd0}};
channel_serving_consumer = 0;
end else begin
…Is this the correct approach? At least it no longer produces an error.
By the way, I converted the SV file to a V file (and made adjustments to fit V), but it seems like learning SV through this project would be a good choice. What are the advantages of using SV for this project?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels