Re: RTL Vs Behavioral
Behavioural code: used to check the
functionality of the design.Mostly Cannot be synthesized.
RTL: it is jargon in design for the mixture of behavioural(part which can be synthesized) and dataflow modeling.
say we are implementing a multiplier.
then behavioural code will be
//behavioural
module Multiplication(i,o,i1);
input [3:0] i,i1;
output [7:0] o;
reg [7:0] o;
always @(i or i1)
o=multi(i,i1);
function [7:0] multi;
input [3:0] I,I1;
integer l;
reg C;
begin
{C,multi}=I*I1;
end
end
endfunction
endmodule
//rtl implementation
function [7:0] multi;
input [3:0] I,I1;
integer l;
reg C;
begin
multi=0;
for(l=0;l<4;l=l+1)
begin
if(I1[l]==1'b1)
{C,multi[7:4]}=multi[7:4]+I;
multi=multi>>1;
multi[7]=C;
C=1'b0;
end
end
endfunction
endmodule
In the former we realized the multiplier abstractly we but didnt mention how , in the latter
we showcased that it is through shift and add,
which can be implemented, as is the case with
today's processors where the multiplier unit is
hardwired or comes with math coprocessor.