Mar 10, 2011 #1 S spman Advanced Member level 4 Joined Aug 15, 2010 Messages 113 Helped 0 Reputation 0 Reaction score 0 Trophy points 1,296 Activity points 2,061 i have wriiten a sram code : Code: module t5(Addr, IO, Clk, RWL, ResetL); input [2:0] Addr; input Clk, RWL, ResetL; inout [7:0] IO; reg [7:0] r [7:0]; integer i; always @(posedge Clk or negedge ResetL) if (!ResetL) begin for (i = 0; i < 8; i=i+1) r[i] <= 0; end else begin if (!RWL) r [Addr] <= IO; end assign IO = (!RWL) ? 8'bz : r[Addr]; endmodule now i want to test it with test fixture. Code: module tt5; // Inputs reg [2:0] Addr; reg Clk; reg RWL; reg ResetL; // Bidirs wire [7:0] IO; // Instantiate the Unit Under Test (UUT) t5 uut ( .Addr(Addr), .IO(IO), .Clk(Clk), .RWL(RWL), .ResetL(ResetL) ); initial begin // Initialize Inputs Addr = 0; Clk = 0; RWL = 0; ResetL = 0; // Wait 100 ns for global reset to finish #100; ResetL = 1; Addr = 1; IO = 10; #50; Clk = 1; #50; Clk = 0; RWL = 1; // Add stimulus here end endmodule ISE gives an error in this line : IO = 10; "Procedural assignment to a non-register <IO> is not permitted." also i tried this code : assign IO = 10; but the same error was repeated! how to solve it?
i have wriiten a sram code : Code: module t5(Addr, IO, Clk, RWL, ResetL); input [2:0] Addr; input Clk, RWL, ResetL; inout [7:0] IO; reg [7:0] r [7:0]; integer i; always @(posedge Clk or negedge ResetL) if (!ResetL) begin for (i = 0; i < 8; i=i+1) r[i] <= 0; end else begin if (!RWL) r [Addr] <= IO; end assign IO = (!RWL) ? 8'bz : r[Addr]; endmodule now i want to test it with test fixture. Code: module tt5; // Inputs reg [2:0] Addr; reg Clk; reg RWL; reg ResetL; // Bidirs wire [7:0] IO; // Instantiate the Unit Under Test (UUT) t5 uut ( .Addr(Addr), .IO(IO), .Clk(Clk), .RWL(RWL), .ResetL(ResetL) ); initial begin // Initialize Inputs Addr = 0; Clk = 0; RWL = 0; ResetL = 0; // Wait 100 ns for global reset to finish #100; ResetL = 1; Addr = 1; IO = 10; #50; Clk = 1; #50; Clk = 0; RWL = 1; // Add stimulus here end endmodule ISE gives an error in this line : IO = 10; "Procedural assignment to a non-register <IO> is not permitted." also i tried this code : assign IO = 10; but the same error was repeated! how to solve it?
Mar 11, 2011 #2 Y yanzixuan Member level 3 Joined Feb 26, 2009 Messages 65 Helped 10 Reputation 20 Reaction score 6 Trophy points 1,288 Activity points 1,573 in module tt5, the IO should be a reg type, not a wire...
Mar 11, 2011 #3 RBB Full Member level 5 Joined Jul 2, 2007 Messages 303 Helped 71 Reputation 142 Reaction score 36 Trophy points 1,308 Location USA Activity points 2,560 Try something like this.. Code: wire [10:0] IO; reg [10:0] IOreg; assign IO = IOreg; initial begin IOreg = some value; #(some time) IOreg = some value; #(some time) IOreg = {10{1'bz}}; // tristate end
Try something like this.. Code: wire [10:0] IO; reg [10:0] IOreg; assign IO = IOreg; initial begin IOreg = some value; #(some time) IOreg = some value; #(some time) IOreg = {10{1'bz}}; // tristate end