SS5
Occasional Contributor
7 years agoVerilog Code Error: Counter : Read and writer through PIO
Hi,
I am trying to read and write 8-bit Counter data Using Quartus and NIOS.
In SOPC : I am assigning PIO : 1-bit input for enable
PIO : 8-bit output for out
module Counter_Top_Level_design
(
input clk, rst_n,
output wire[7:0] out
);
wire enable;
always @ (posedge clk or negedge rst_n)
begin
if (~rst_n)
out <= 0;
else if (enable == 1'b1)
out <= out + 1;
end
NIOS_SYSTEM niosii_system_inst (
.clk_clk (clk ), // clk.clk
.reset_reset_n (rst_n ), // reset.reset_n
.output_pio_export ( enable ), // output_pio.export
.counter_out_export (out)
);
endmoduleI am getting an Error message :
Error (10137): Verilog HDL Procedural Assignment error at Counter_Top_Level_design.v(11): object "out" on left-hand side of assignment must have a variable data type
Error (10137): Verilog HDL Procedural Assignment error at Counter_Top_Level_design.v(13): object "out" on left-hand side of assignment must have a variable data type