I'd go a bit further with the variable "=" (blocking) and signal
(non-blocking) "<=" assignments.
1) The above statement implies a clocked process. Combinatorial
processes in Verilog should always use blocking "=" assignments.
Assignments outside of a process need to use the "assign" form
in Verilog:
VHDL:
foo <= bar;
Verilog:
assign foo = bar; // Using "<=" here will generate a syntax error
2) When using the equivalent of "variables" in verilog, I would
recommend declaring them locally to avoid use outside the process.
Otherwise you risk race conditions in simulation leading to
unpredictable differences between simulation and hardware.
always @ (posedge clk or negedge reset_n)
begin : named_proc
integer some_variable
reg [3:0] some_other_variable
if (!reset_n)
begin
// asynch reset terms go here
// even though it wouldn't seem to matter
// use blocking assignments for variables here, too
// synthesis will barf if you use both assignment types
// on the same variable
some_variable = 0;
some_other_variable = 4'd55; // Gotcha! 55 doesn't fit in 4 bits,
// but no warning or error!
my_sig <= 0; // Unsized constants are 32 bits, but don't need to
// match the variable's size, so this is legal
end
else
begin
// clocked terms go here
end
end
Note that you need a named process to include local declarations
within the process in Verilog. The process name will show up in
the netlist hierarchy for the local variables.
Obviously there are a lot more differences between the languages,
and it would be good to get a primer on how Verilog is simulated
to understand for example why you need to use edge sensitivity
for an asynchronous reset, when in hardware this would be a
level-sensitive input.
If you use Xilinx products, you can look at the language templates
for common sythesis constructs and see how they're done in both
languages as a guide to conversion for synthesis.
I haven't use VHDL for simulation at all, but I'm sure that's
where you'll need more help if you don't want to keep your
test benches in VHDL for your synthesizable Verilog projects.
Luckily it seems that most Verilog books spend most of their
pages on simulation constructs (and also unfortunately if
you were hoping to quickly get up to speed on Verilog for
synthesis).
-- Gabor