arishsu
Member level 3
- Joined
- Sep 10, 2013
- Messages
- 66
- Helped
- 6
- Reputation
- 12
- Reaction score
- 6
- Trophy points
- 8
- Location
- India
- Activity points
- 422
Hi
I am getting an error when synthesized the code
The top block is
And code for timer1 is
I am getting an error when synthesized the code
WARNING:Xst:1290 - Hierarchical block <TIM1> is unconnected in block <digital_lock_top>.
It will be removed from the design.
The top block is
Code Verilog - [expand] 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 module digital_lock_top(key,unlock,alarm,display_code,clk_50Mhz,lock_reset,door_sensor); input[0:9]key; input clk_50Mhz,door_sensor,lock_reset; output alarm,unlock; output [6:0]display_code; wire key_code,key_dep,code_sw,any_sw,timeout,select_timeout,en_tim1; wire [1:0] select; clock_divider CLK_DIV(clk_50Mhz,clk); key_pad_ckt KEY_PAD(key,select,key_code,key_dep); lock_FSM_controller FSM(code_sw,any_sw,lock_reset,clk,timeout,select_timeout,unlock,alarm,en_tim1,select); fall_edge_detector FALL_ED(key_code,clk,key_dep,code_sw,any_sw); timer1 TIM1(clk,en_tim1,door_sensor,timeout); timer2 TIM2(clk,code_sw,select_timeout,select); display_decoder DISPLAY(unlock,alarm,display_code); endmodule
And code for timer1 is
Code Verilog - [expand] 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 module timer1(clk,en_tim1,door_sensor,timeout); input clk,en_tim1,door_sensor; output timeout; reg timeout; reg [14:0]count; initial begin timeout=0; end always@(posedge en_tim1) begin count=15'b000000000000111;//assuming clk=1KHz, count=32.7 sec end always@(posedge clk) begin if(!en_tim1 || !door_sensor) begin timeout=0; end else if(en_tim1 && door_sensor && count>0) begin count=count-1; timeout=(count==0)?1:0; end else if (!en_tim1 && door_sensor) begin timeout=0; end end endmodule
Last edited by a moderator: