Professional Documents
Culture Documents
Timing Exception Lab
Timing Exception Lab
CODE:1
module fp2( index, in0, in1, in2, a, b, out1, out2);
input index;
input [15:0] in0, in1, in2;
input [31:0] a, b;
output [31:0] out1, out2;
reg [1:0] muxReg;
wire [15:0] t0;
wire [31:0] t1;
always @*
begin
muxReg = 2'b0;
muxReg[index] = 1'b1;
end
assign t0 = (muxReg[0] ? in1 : in0);
assign out1 = t0 * in2;
assign t1 = a + b;
assign out2 = (muxReg[1] ? out1 : t1);
endmodule
Resource Utilization:
Implementation :
RTL Code :2
module mcp_chg( clk, rst, a_in, b_in, out);
input clk, rst;
input [31:0] a_in, b_in;
output [31:0] out;
reg [31:0] a, b, out;
reg [1:0] state;
wire [31:0] out_sum, out_mul;
assign out_sum = (a + b);
assign out_mul = (a * b);
always @(posedge clk)
begin
if (rst)
out = 0;
else
out = (state == 1 ? out_sum : state == 2 ? out_mul : 0);
end
always @(posedge clk)
begin
if (rst)
begin
a = a_in; b = a_in;
state = 2'd1;
end
else
begin
if (state == 2'd0)
begin
a = a_in;
b = b_in;
state = state + 1'b1;
end
else if (state == 2'd1)
state = state + 1'b1;
else if (state == 2'd2)
state = 2'd0;
end
end
endmodule
Utilization report:
STATIC
STATIC
------------------------------------------------------------------------------------
| Tool Version : Vivado v.2018.3 (win64) Build 2405991 Thu Dec 6 23:38:27 MST
2018
| Date : Sat Apr 4 19:03:04 2020
| Host : SauDips running 64-bit major release (build 9200)
| Command : report_timing -from [all_registers] -to [all_registers] -hold
| Design : mcp_chg
| Device : 7z020-clg484
| Speed File : -1 PRODUCTION 1.11 2014-09-11
------------------------------------------------------------------------------------
Slack (MET) : 0.230ns (arrival time - required time)
Source: state_reg[1]/C
(rising edge-triggered cell FDRE clocked by clk
{rise@0.000ns fall@4.500ns period=9.000ns})
Destination: state_reg[0]/D
(rising edge-triggered cell FDRE clocked by clk
{rise@0.000ns fall@4.500ns period=9.000ns})
Path Group: clk
Path Type: Hold (Min at Fast Process Corner)
Requirement: 0.000ns (clk rise@0.000ns - clk rise@0.000ns)
Data Path Delay: 0.474ns (logic 0.245ns (51.700%) route 0.229ns
(48.300%))
Logic Levels: 1 (LUT3=1)
Clock Path Skew: 0.145ns (DCD - SCD - CPR)
Destination Clock Delay (DCD): 0.982ns
Source Clock Delay (SCD): 0.628ns
Clock Pessimism Removal (CPR): 0.209ns
-----------------------------------------------------------------------------------------
Slack at Min at Fast Process Corner 0.230 ns and Require Time is 0.872 and arrival
time is 1.102 ns .
Implementation :
Constraints Provided :
The
Implementation failed due to the above constraints.
The
RTL Code :3
module constant_mux( in1, in2, in3, contl, z, out, IN1, IN2, IN3, CONTL, OUT);
input in1, in2, in3, contl, z;
output out;
input IN1, IN2, IN3, CONTL;
output OUT;
wire t1, t2;
wire T1, T2;
assign t1 = (contl ? in1 : z);
assign t2 = (t1 | in2);
assign out = (contl ? z : t2);
assign T1 = (CONTL ? IN1 : 1'b0);
assign T2 = (T1 | IN2);
assign OUT = (CONTL ? 1'b0 : T2);
endmodule