Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

wait command implementing on hardware... URGENT

Status
Not open for further replies.

jawadysf

Newbie level 5
Joined
Nov 27, 2008
Messages
10
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,351
how to replace the wait command when implementing the code on hardware?

e.g in the following code how to replace the # for hardware implementation

module word_gen(clk,cmd,data,status);
input clk;
output cmd;
output data;
output status;
reg cmd,data,status;
//Generation of syns of words
initial
begin
cmd=1'b1; //Syns of Command word is on for 1.5uses
status=1'b1; //Syns of Status word is on for 1.5uses
data=1'b0; //Syns of data word is off for 1.5uses
#1.5 cmd=1'b0; status=1'b0; data=1'b1; //Syns of data word is on for 1.5uses
#1.5 $finish; //Syns of commandn and status word is of for 1.5uses
end

endmodule
 

Not all HDL statements are synthesizeable. Some are just dedicated for simulation or easier-coding. Wait for a certain period of time is one of them.

If you want to achieve a delay of time which is much longer than the system clock, you can use a counter to wait. If it is relatively equal or even smaller than system clock you should take care about propagation delay of physic signal through route and LUTs to put into the path you need delay some LUTs. But it is complicated.

In addition, unfortunatly, Place and Route phase may cause some changes because of some LUTs added for routing through due to no direct ways between logic blocks or between logic blocks and IO blocks. As you know it's not the fact that all LUTs you need for a logic function are put next to each other.
 

i've developed the following code using counter but didn'nt get the required result...( () please help.


module sync(clk,enable,signal,count);
input clk;
input enable;
output [5:0] signal;
output [2:0] count;
reg [5:0] signal;
reg [2:0] count;

// Increment count on clock
initial
count = 0;
always @(clk or enable or count)

begin
if (enable)
count = count+1;
begin


if (count <= 3'b001)
signal[0] = 1'b1;
else if (count <= 3'b010)
signal[1] = 1'b1;
else if (count <= 3'b011)
signal[2] = 1'b1;
else
signal[3] = 1'b0;
signal[4] = 1'b0;
signal[5] = 1'b0;
end
end

endmodule
 

Of course you didn't.

1stly, your counter is misdesigned. You should use posedge of CLK to trigger the counter to make it Flip-flop, not latches on just enable like what you did.

2ndary, try thinking when your signal is assigned back to 6'b00 ???[/i][/b]
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top