5th Exp
5th Exp
CODING :
module fsm_40_tb_v;
// Inputs
reg clk;
reg [1:0] coin;
reg rst;
// Outputs
wire nw_pa;
TEST BENCH :
module fsm_40_tbs_v;
// Inputs
reg clk;
reg [1:0] coin;
reg rst;
// Outputs
wire nw_pa;
=========================================================================
* Final Report *
=========================================================================
Final Results
RTL Top Level Output File Name : fsm_40.ngr
Top Level Output File Name : fsm_40
Output Format : NGC
Optimization Goal : Speed
Keep Hierarchy : NO
Design Statistics
# IOs :5
Macro Statistics :
# Registers :4
# 1-bit register :4
Cell Usage :
# BELS :7
# LUT2 :2
# LUT4 :5
# FlipFlops/Latches :9
# FDC :4
# FDP :1
# LD :4
# Clock Buffers :1
# BUFGP :1
# IO Buffers :4
# IBUF :3
# OBUF :1
=========================================================================
=========================================================================
TIMING REPORT
Clock Information:
------------------
-----------------------------------+------------------------+-------+
Clock Signal | Clock buffer(FF name) | Load |
-----------------------------------+------------------------+-------+
clk | BUFGP |5 |
_n0011(_n00112:O) | NONE(*)(next_state_1) | 4 |
-----------------------------------+------------------------+-------+
(*) This 1 clock signal(s) are generated by combinatorial logic,
and XST is not able to identify which are the primary clock signals.
Please use the CLOCK_SIGNAL constraint to specify the clock signal(s) generated by combinatorial logic.
INFO:Xst:2169 - HDL ADVISOR - Some clock signals were not automatically buffered by XST with
BUFG/BUFR resources. Please use the buffer_type constraint in order to insert these buffers to the clock
signals to help prevent skew problems.
Timing Summary:
---------------
Speed Grade: -4
Minimum period: No path found
Minimum input arrival time before clock: 6.028ns
Maximum output required time after clock: 6.198ns
Maximum combinational path delay: No path found
Timing Detail:
--------------
All values displayed in nanoseconds (ns)
=========================================================================
Timing constraint: Default OFFSET IN BEFORE for Clock '_n00112:O'
Total number of paths / destination ports: 8 / 4
-------------------------------------------------------------------------
Offset: 6.028ns (Levels of Logic = 3)
Source: coin<1> (PAD)
Destination: next_state_0 (LATCH)
Destination Clock: _n00112:O falling
=========================================================================
Timing constraint: Default OFFSET OUT AFTER for Clock 'clk'
Total number of paths / destination ports: 1 / 1
-------------------------------------------------------------------------
Offset: 6.198ns (Levels of Logic = 1)
Source: state_3_1 (FF)
Destination: nw_pa (PAD)
Source Clock: clk rising
=========================================================================
CPU : 0.91 / 1.02 s | Elapsed : 1.00 / 1.00 s
-->
Post lab :
// State registers
reg [1:0] current_state, next_state;
case (current_state)
S0: begin
if (in)
next_state = S1;
out = 1; // Output in state S0
end
S1: begin
if (in)
next_state = S2;
end
S2: begin
// Stay in S2
out = 1; // Output in state S2
end
Test bench :
module asml_40tb_v;
// Inputs
reg clk;
reg reset;
reg in;
// Outputs
wire out;
initial begin
// Initialize Inputs
clk = 0;
reset = 0;
in = 0;
clk = 0;
reset = 1;
in = 0;
#100;
clk = 0;
reset = 1;
in = 1;
#100;
clk = 1;
reset = 0;
in = 0;
#100;
clk = 1;
reset = 0;
in = 1;
#100;
clk = 1;
reset = 1;
in = 0;
#100;
clk = 1;
reset = 1;
in =1;
#100;
end
endmodule