|
代码:
parameter size=8,longsize=16;
reg [size:1] opa, opb;
reg [longsize:1] result;
begin: mult
reg [longsize:1] shift_opa, shift_opb;
shift_opa = opa;
shift_opb = opb;
result = 0;
repeat(size)
begin
if(shift_opb[1])
result = result + shift_opa;
shift_opa = shift_opa <<1;
shift_opb = shift_opb >>1;
end
end
用modelsim仿真提示:
vlog -work work D:/test/mult.v
Model Technology ModelSim SE vlog 6.0 Compiler 2004.08 Aug 19 2004
** Error: D:/test/mult.v(1): near "parameter": expecting: LIBRARY CONFIG
** Error: D:/test/mult.v(4): near "begin": expecting: LIBRARY CONFIG
** Error: D:/test/mult.v(6): near "shift_opa": expecting: LIBRARY CONFIG
请大家指点一下。谢谢了! |
|