Академический Документы
Профессиональный Документы
Культура Документы
D FLIP-FLOP
moduledff(D,Q,Clock,Reset); // N.B. reset is
active-low
outputQ;inputD,Clock,Reset;
parameterCARDINALITY = 1;reg[CARDINALITY-1:0]
Q;
wire[CARDINALITY-1:0] D;
always@(posedgeClock)if(Reset!==0)
#1 Q=D;
alwaysbeginwait(Reset==0);
Q=0;wait(Reset==1);end
endmodule
D FLIP-FLOP - MODEFIED
moduledff(D, Q, Clk, Rst); // new flip-flop for
Viterbi decoder
parameterwidth = 1, reset_value =
0;input[width - 1 : 0] D;
output[width - 1 : 0] Q;reg[width - 1 : 0]
Q;inputClk, Rst;
initialQ <= {width{1'bx}};
always@ (posedgeClkornegedgeRst )
if( Rst == 0 ) Q <= #1 reset_value;elseQ
<= #1 D;
endmodule
Delays in Verilog
Synthesis tools ignore delay values.
They musthow can a synthesis tool guarantee that logic
will have a certain delay?
For example, a synthesizer cannot generate hardware to
implement the following Verilog code:
moduleStep_Time(clk, phase);
inputclk;output[2:0] phase;reg[2:0] phase;
always@(posedgeclk)begin
phase <= 4'b0000;
phase <= #1 4'b0001; phase <= #2 4'b0010;
phase <= #3 4'b0011; phase <= #4 4'b0100;
end
endmodule
default: phase = #1 0;
endcase
endmodule
Inrealhardwaretwosignalswouldberacingeachotherandthewinner
isunclear.
Wemustthinklikethehardwaretoguidethesynthesistool.Combining
theassignmentstatementsintoasinglealwaysstatement,asfollows,
isonewaytosolvethisproblem:
moduleno_race_1(clk,q0,q2);inputclk,
q0;outputq2;regq1,q2;
always@(posedgeclk)beginq2=q1;q1=q0;end
Endmodule
We can also avoid the problem if we use nonblocking
assignment statements,
moduleno_race_2(clk, q0, q2);inputclk,
q0;outputq2;regq1, q2;
always@(posedgeclk) q1 <= #1
q0;always@(posedgeclk) q2 <= #1 q1;
endmodule
This code updates all the registers together, at the end of
a time step, soq2always gets the old value ofq1.
endmodule
Continuous assignment statements also imply
combinational logic (notice thatzis now awirerather
Multiplexers In Verilog
We imply a MUX using acasestatement, as in the
following example:
Multiplexers in VHDL
Multiplexers can be synthesized using acasestatement
(avoiding the VHDL reserved word'select'), as the
following example illustrates:
entityMux4is port(i: BIT_VECTOR(3downto0); sel:
BIT_VECTOR(1downto0); s:outBIT);
endMux4;
architectureSynthesis_1ofMux4is
beginprocess(sel, i)begin
caseselis
when"00" => s <= i(0);when"01" => s <= i(1);
when"10" => s <= i(2);when"11" => s <= i(3);
endcase;
endprocess;
endSynthesis_1;
Types of Simulation
Simulators are usually divided into the
following categories orsimulation modes:
Behavioral simulation
Functional simulation
Static timing analysis
Gate-level simulation
Switch-level simulation
Transistor-level or circuit-level simulation
This list is ordered from high-level to low-level
simulation (high-level being more abstract,
and low-level being more detailed).
Boundary-Scan Test
It is possible to test ICs in dual-in-line
packages (DIPs) with 0.1 inch (2.5 mm)
lead spacing on low-density boards using
abed-of-nails testerwith probes that
contact test points underneath the board.
Mechanical testing becomes difficult with
board trace widths and separations below
0.1 mm or 100 mm, package-pin
separations of 0.3 mm or less, packages
with 200 or more pins, surface-mount
packages on both sides of the board, and
multilayer boards
Normally the boundary-scan shiftregister cells at each ASIC I/O pad are
transparent, allowing signals to pass
between the I/O pad and the core logic.
When an ASIC is put into boundaryscan test mode, we first tell the TAP
controller which TDR to select.
The TAP controller then tells each
boundary-scan shift register in the
appropriate TDR either to capture input
data, to shift data to the neighbouring
cell, or to output data.
Boundary-scan terminology
BST Cells
Boundary-Scan Controller
Faul
ts
Problems may introduce adefectthat in turn
may introduce afault(Sabnis [1990]
describesdefect mechanisms).
Any problem during fabrication may prevent a
transistor from working and may break or join
interconnections
We can measure the overallreliabilityof any
product using themean time between
failures(MTBF) for a repairable product
ormean time to failure(MTTF) for a fatal
failure. We also usefailures in time(FITs)
where 1 FIT equals a single failure in
109hours.
Fault models
Physical Faults
Logical Faults
(a)Physical faults at the
layout level
(b)We can translate
some of these
faults to the
simplified transistor
schematic.
(c) Only a few of the
physical faults
still remain in a gatelevel fault
model of the logic
cell.
(d)Finally at the
functional-level
fault model of a logic
cell,
IDDQ
Test
When
they receive a prototype ASIC, experienced
Fault Simulation