Three levels



Behavioral has the highest layer of abstraction which describes the overall behavior and is often not synthesizeable, but is useful for verification. (Abstraction 반대 : gate 수준(NAND, NOR etc))



RTL describes the hardware you want by implying logic. Defining flip-flops, latches and how data is transfered between them. This is synthesizable synthesis may alter/optimize the logic used but not behavior. Switching muxes for gates etc some times inverting signals to better optimize the design.



Verilog RTL implying a flip-flop :


logic a;    // logic is SystemVerilog, could be a 'reg'

logic k;    // Driven by RTL not shown

always @ (posedge clk or negedge rst_n) begin

if (~rst_n) begin

a <= 'b0';

end

else begin

a <= k;

end

end


Combinatorial Bitwise operators :


logic [1:0] n;

logic [1:0] m;

logic [1:0] result;


assign result = n & m;



Gate level is a design using the base logic gates (NAND, NOR, AND, OR, MUX, FLIP-FLOP). It does not need to be synthesized or is the output from synthesis. This has the lowest level of abstraction. It is the logic gates that you will use on the chip, but it lacks positional information.



Gate level verilog (same function as above) :


wire a;

wire k;

DFFRX1 dffrx1_i0 (

.Q (a),    //Output

.QN( ),     //Inverted output not used

.D( (k),     //Input

.CK(clk),     //Clk

.RN(rst_n)    //Active low async Reset

);


Combinatorial


logic [1:0] n;

logic [1:0] m;

logic [1:0] result;


AND2X1 and2x1_i0 (

.Y (result[0]),

.A (n[0]),

.B (m[0])

);

AND2X1 and2x1_i1 (

.Y (result [1]),

.A (n[1]),

.B (m[1])

);


'Language > verilog HDL' 카테고리의 다른 글

blocking과 nonblocking 연산자 의미  (0) 2016.11.27
Assignment  (0) 2016.11.23
Gate delay, net delay  (0) 2016.11.23
Gate-level, Dataflow, Behavoral modeling  (0) 2016.11.22
Little endian, Big endian  (0) 2016.11.16
Posted by 나무길 :