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.

sensitivity list

Status
Not open for further replies.

Balaji Chirumamilla

Newbie level 1
Joined
Jul 13, 2013
Messages
0
Helped
0
Reputation
0
Reaction score
0
Trophy points
0
Activity points
0
can i use reset in sensitivity list like this.............?




here i want to generate one signal so that it will behave exactly like reset with out any delay's and and i want to generate one flag which tells that reset operation was done,

DOUBT: as i am new to verilog, here i have doubt wheather this code is synthasizable or not................................?

please clarify it




DESIGN

module copy_reset(clk,reset,copy,copy1,copy2);
input clk;
input reset;

output copy;
output copy1;
output copy2;

reg copy;
reg copy1;
reg copy2;

always@(reset)
begin
if (!reset)
copy<=1'b0;
else
copy<=1'b1;
end

always@(posedge clk or negedge reset)
begin
if(!reset)
copy1<=1'b0;
else
copy1<=copy;
end

always@(posedge clk or negedge reset)
begin
if(!reset)
copy2<=1'b0;
else
copy2<=copy1;
end

endmodule

*******************************************************************************************************************

TESTBENCH



module copy_reset_tb();
reg clk;
reg reset;

wire copy;
wire copy1;
wire copy2;

copy_reset copy_reset_i(.clk(clk),
.reset(reset),
.copy(copy),
.copy1(copy1),
.copy2(copy2));



initial
begin
clk=1'b0;
reset=1'b0;
end

always #5 clk=~clk;

initial
begin
#8;
@(posedge clk);
reset=1'b1;

#18;
reset=1'b0;

#8;
@(posedge clk);
reset=1'b1;
end

initial
begin
#1500 $finish;
end
endmodule
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top