J
Justas P
Guest
Hi all,
first of all - sorry, if my questions look like homework/univ
questions. Never had Verilog at university, trying to learn it myself.
I am making deserializer. I have 3 inputs - clock, serial data and
sync so I know where block of data start. What I want to do is to say
to my uC that 8 bits were deserialised and are ready to be taken:
module deser(
clock,
ser_d_in,
par_d_out,
int_req,
int_ack,
sync
);
input clock, ser_d_in, int_ack, sync;
output [7:0] par_d_out;
output int_req;
reg [7:0] par_d_out;
reg [7:0] buffer;
reg [3:0] counter;
reg int_condition;
assign int_req = (int_condition == 'b1) ? 'b0 : 'b1;
always @(posedge clock) begin
counter = (sync) ? 'b0000 : counter + 'd1;
buffer = { ser_d_in, buffer[7:1]};
par_d_out = (counter == 'b1111) ? buffer : par_d_out;
int_condition = (counter == 'b1111) ? 'b1 : int_condition;
end
always @(negedge int_ack) begin
int_condition = 'b0;
end
endmodule
I am using Xilinx free ISE edition and get this when trying to
implement:
Xst:528 - Multi-source in Unit <deser> on signal <int_req>; this
signal is connected to multiple drivers.
Can anyone help me out with this?
Also - as I understand I should not use non-blocking assignments in
"always @(posedge clock)" because I increment "counter" and later do
actions that depend on value of "counter".
Finally - if I'm doing something terribly stupid, and there is a
better way to implement same functionality I am open to ideas.
Thanks in advance,
Justin
first of all - sorry, if my questions look like homework/univ
questions. Never had Verilog at university, trying to learn it myself.
I am making deserializer. I have 3 inputs - clock, serial data and
sync so I know where block of data start. What I want to do is to say
to my uC that 8 bits were deserialised and are ready to be taken:
module deser(
clock,
ser_d_in,
par_d_out,
int_req,
int_ack,
sync
);
input clock, ser_d_in, int_ack, sync;
output [7:0] par_d_out;
output int_req;
reg [7:0] par_d_out;
reg [7:0] buffer;
reg [3:0] counter;
reg int_condition;
assign int_req = (int_condition == 'b1) ? 'b0 : 'b1;
always @(posedge clock) begin
counter = (sync) ? 'b0000 : counter + 'd1;
buffer = { ser_d_in, buffer[7:1]};
par_d_out = (counter == 'b1111) ? buffer : par_d_out;
int_condition = (counter == 'b1111) ? 'b1 : int_condition;
end
always @(negedge int_ack) begin
int_condition = 'b0;
end
endmodule
I am using Xilinx free ISE edition and get this when trying to
implement:
Xst:528 - Multi-source in Unit <deser> on signal <int_req>; this
signal is connected to multiple drivers.
Can anyone help me out with this?
Also - as I understand I should not use non-blocking assignments in
"always @(posedge clock)" because I increment "counter" and later do
actions that depend on value of "counter".
Finally - if I'm doing something terribly stupid, and there is a
better way to implement same functionality I am open to ideas.
Thanks in advance,
Justin