System Verilog Overview-Ibm
System Verilog Overview-Ibm
Presentation Objectives
• Provide a brief history and status update
of SystemVerilog as a HW Design &
Verification Language
• Provide a high level overview of the
language capabilities and usage aspects
Design Size
• Quest for Performance is driving up
complexity
– Deeper pipelines, increase in logic
functionality and complexity, power issues,
explosion in flops
Verilog RTL
• Explosion in lines of RTL Code making
verification a lot harder Schematics
• Low Abstraction level of the RTL is driving 80’s 90’s
higher verification effort and lower
simulation speed
– Trillions of cycles per lead project and Increasing rate
# Pre-silicon bugs
more pre-silicon bug escapes
• Verification effort is reaching 60% of the
total design cycle
– Usage of different languages makes it even
harder: reference models in C/C++, RTL in
Verilog or VHDL, Test Benches,
Assertions, Checkers, Coverage Lead Projects
SystemVerilog
SystemVerilogIEEE
IEEEStandard
Standardis
isexpected
expected
to
tobecome
becomeavailable
availableby
byOct’2005
Oct’2005
Verilog2K
Multi-D Arrays Generate Automatic Tasks
Verilog95
Gate Level Modeling & Timing Hardware Concurrency
be g
se ilog
h
s t r ilo
Language with for semiformal and
nc
Testbench rti
Te Ve
Coverage formal methods.
on The Assertion
IEEE Language Standard
Verilog for Verilog
PI
2001 A e
Ve sig
I & ac
De
f
rilo n
P
D nt er
g
Design I
Abstraction:
Interface Direct C interface,
semantics, abstract Assertion API and
data types, Coverage API
abstract operators
and expressions
(transfer/merge)
SystemVerilog Introduction (9)
SystemVerilog Design Modeling
SystemVerilog enhances Verilog for Design Modeling
packed
array of bit [3:0] p;
bits
packed
struct
tests
testseach
eachcase
casecondition
conditionininorder
orderand
and
tests
testsall
allcase
caseconditions
conditionsand
andmakes
makessure
sure makes sure there is at least one branch
makes sure there is at least one branch
that
thatone
oneand
andonly
onlyone
onecondition
conditionmatches
matches taken
taken
Declaration syntax
<type> <identifier> [<index_type>];
<type> <identifier> [*]; // “arbitrary” type
Built-in Methods
num(), delete([index]), exists(index);
first/last/prev/next(ref index);
Ideal
Idealfor
forDealing
Dealingwith
withSparse
SparseData
Data
SystemVerilog Introduction (30)
Object-Oriented Programming
• Organize programs in the • Class – A blueprint for a house
same way that objects – Program element “containing”
related group of features and
are organized in the real functionality.
world – Encapsulates functionality
• Break program into – Provides a template for building
objects
blocks that work together
• Properties – It has light switches
to accomplish a task,
– Variables specific to the class
each block has a well
• Methods – Turn on/off the lights
defined interface
– Tasks/functions specific to the
• Focuses on the data and class
what you are trying to do • Object – The actual house
with it rather than on – An object is an instance of a
class
procedural algorithms
Class
Classdeclaration
declarationdoes
doesnot
not allocate
allocate
any
anystorage
storage
SystemVerilog Introduction (32)
OOP - Class Instantiation
• Objects Allocated Packet myPkt = new;
Packet: ErrPkt:
cmd cmd
status get_status status get_status
show_err
header header
set_cmd set_cmd
cmd = a; err cmd = a+1;
Allows
AllowsCustomization
CustomizationWithout
WithoutBreaking
Breakingor
orRewriting
Rewriting
Known-Good
Known-GoodFunctionality
Functionalityininthe
theParent
ParentClass
Class
• SystemVerilog adds
– a semaphore built-in class - for synchronization and mutual exclusion
to shared resources
– a mailbox built-in class - communication channel between processes
– event data type to satisfy system-level synchronization requirements
semaphores
begin ... ...
@(ev) shrdBus.get () fork
...//access granted go_cpu(cpu1,ev1);
...//activity on the cpu bus go_cpu(cpu2,ev2);
shrdBus.put() ...
CPU1 CPU2 join
... Cache Cache ...
endtask
Guarantees
GuaranteesRace-Free
Race-FreeSynchronization
Synchronization
Between
BetweenProcesses
Processes
SystemVerilog Introduction (36)
Process Synchronization - Mailbox
• Mailbox features
– FIFO message queue: passes data between threads
– Can suspend thread, used for data checking
• Mailbox built-in methods
– new(), num(), put(), try_put(), get(), try_get(), peek(), try_peek()
Packet 3
Packet 1
Packet 4
Packet
Stimulus
Compare
DUT output
Input to
Design
fork a;b;c;
a c join_any
b
wait fork; // wait for children to complete
#10;
$exit
int i; int i;
logic [7:0] a; wire [7:0] a;
interface intf;
typedef struct { At
Atthethesimplest
simplest int i;
int i; level an interface
logic [7:0] a; level an interface wire [7:0] a;
isistotoaawire
wire endinterface : intf
} s_type;
what
whataastruct structisis
totoaavariable
variable
modA m1(w);
modB m2(w); An
Aninterface
interfacecan
cancontain
contain
endmodule anything
anythingthat
thatcould
couldbebeininaa
module
moduleexcept
exceptother
other
module modA (intf i1);
endmodule module
moduledefinitions
definitionsor
or
module modB (intf i1); instances
instances
endmodule
ev e l
System Verilog System C f o r S ys te m L
Use
Design Architecture
Netlist RTL
System
System Verilog
Verilog&&System
System CCComplement
ComplementEach Each
Other
Otherin
inARCH
ARCH Physical
Physical Design
Design Flow
Flow
SystemVerilog Introduction (56)