A
Aldorus
Guest
Hello:
I am trying to implement a PS2 keyboard read routine. Basically,
use the keyboard clock to shift 11 bits through a register. I am getting
an odd error. Heres a SMALL snippet that shows the error under ISE 9
*******************************************
module _kb_echo (input ExtClk,
input ExtRst,
input ExtKbClk,
input ExtKbData,
output [1:0] ExtLedVcc,
output [6:0] ExtLedC);
reg [10:0] InKbWd;
mod_kb_read _mod_kb_read(ExtRst,ExtKbClk,ExtKbData,InKbWd);
endmodule
module mod_kb_read (input Rst,
input KbClk,
input KbData,
output reg [10:0] KbWd);
always @ (negedge KbClk or negedge Rst)
begin
KbWd[0] <= KbData;
KbWd[1] <= KbWd[0];
KbWd[2] <= KbWd[1];
KbWd[3] <= KbWd[2];
KbWd[4] <= KbWd[3];
KbWd[5] <= KbWd[4];
KbWd[6] <= KbWd[5];
KbWd[7] <= KbWd[6];
KbWd[8] <= KbWd[7];
KbWd[9] <= KbWd[8];
KbWd[10] <= KbWd[9];
end
endmodule
***********************************************
Heres the offending line:
reg [10:0] InKbWd;
mod_kb_read _mod_kb_read(ExtRst,ExtKbClk,ExtKbData,InKbWd); <---
Why would it complain about an 11 bit register?
Thanks
I am trying to implement a PS2 keyboard read routine. Basically,
use the keyboard clock to shift 11 bits through a register. I am getting
an odd error. Heres a SMALL snippet that shows the error under ISE 9
*******************************************
module _kb_echo (input ExtClk,
input ExtRst,
input ExtKbClk,
input ExtKbData,
output [1:0] ExtLedVcc,
output [6:0] ExtLedC);
reg [10:0] InKbWd;
mod_kb_read _mod_kb_read(ExtRst,ExtKbClk,ExtKbData,InKbWd);
endmodule
module mod_kb_read (input Rst,
input KbClk,
input KbData,
output reg [10:0] KbWd);
always @ (negedge KbClk or negedge Rst)
begin
KbWd[0] <= KbData;
KbWd[1] <= KbWd[0];
KbWd[2] <= KbWd[1];
KbWd[3] <= KbWd[2];
KbWd[4] <= KbWd[3];
KbWd[5] <= KbWd[4];
KbWd[6] <= KbWd[5];
KbWd[7] <= KbWd[6];
KbWd[8] <= KbWd[7];
KbWd[9] <= KbWd[8];
KbWd[10] <= KbWd[9];
end
endmodule
***********************************************
Heres the offending line:
reg [10:0] InKbWd;
mod_kb_read _mod_kb_read(ExtRst,ExtKbClk,ExtKbData,InKbWd); <---
Why would it complain about an 11 bit register?
Thanks