R
Reza Naima
Guest
After I found out that I couldn't syntesize a lot of the verilog code (
http://awlnk.com/?aRts ), I had to redesign how I was going to
implement this design. I'm going for something significantly easier,
though I'm breaking it up into more modular parts. I'm getting all
sorts of errors from all over the place (using both silos synthesizer
and the xilinx webpack). The code is very simple - I want to be able
to set one of 32 pins as high, low, or high impedence using a minimal
number of input pins. The design I came up with so far incorporates a
counter latch/demux. I'm not sure how to implement the highimpedence
functionalty of the output, so I've ignored it for now (though I would
love some input). Here's the code so far -- any help would be greatly
appreciated!! :
module counter32(in,reset,out);
input [0:0] in;
input reset;
output [4:0] out;
always @(posedge in) begin /* i've seen sample code include reset
here, dont know why though */
if (!reset)
out = out + 1;
end
always @(posedge reset)
out = 5'b00000;
endmodule
module latch32(in,out,enable,signal);
input [5:0] in;
output [31:0] out;
input enable;
input signal;
integer N;
always @(posedge enable)
out[in] = signal;
endmodule
module counterLatch32(in,reset,enable,signal,out);
input [0:0] in;
input [0:0] reset;
input [0:0] enable;
input [0:0] signal;
output [31:0] out;
wire [4:0] select;
reg [31:0] out;
module counter32(in, reset, select);
module latch32(select, out, enable, signal);
endmodule
http://awlnk.com/?aRts ), I had to redesign how I was going to
implement this design. I'm going for something significantly easier,
though I'm breaking it up into more modular parts. I'm getting all
sorts of errors from all over the place (using both silos synthesizer
and the xilinx webpack). The code is very simple - I want to be able
to set one of 32 pins as high, low, or high impedence using a minimal
number of input pins. The design I came up with so far incorporates a
counter latch/demux. I'm not sure how to implement the highimpedence
functionalty of the output, so I've ignored it for now (though I would
love some input). Here's the code so far -- any help would be greatly
appreciated!! :
module counter32(in,reset,out);
input [0:0] in;
input reset;
output [4:0] out;
always @(posedge in) begin /* i've seen sample code include reset
here, dont know why though */
if (!reset)
out = out + 1;
end
always @(posedge reset)
out = 5'b00000;
endmodule
module latch32(in,out,enable,signal);
input [5:0] in;
output [31:0] out;
input enable;
input signal;
integer N;
always @(posedge enable)
out[in] = signal;
endmodule
module counterLatch32(in,reset,enable,signal,out);
input [0:0] in;
input [0:0] reset;
input [0:0] enable;
input [0:0] signal;
output [31:0] out;
wire [4:0] select;
reg [31:0] out;
module counter32(in, reset, select);
module latch32(select, out, enable, signal);
endmodule