pyrite
Member level 2
Hi,
I have few questions on the verilog coding style.
Which is better in term of speed/area for synthesis?
Question 1:
a. I can create some small functions such as a function that will do add, a function that will do multiplication. So that every time when I need to do some multiplication (example), i can just call this function.
b. Or I can do the multiplication/addition simply in the code without using functions.
Question 2 (related to question 1):
a. Use function.
b. Use submodule.
Question 3:
a. always @(posedge clk)
a <= b + c;
b. assign d <= b + c;
always @(posedge clk)
a <= d;
Question 4:
a. if (b == 3'b111)
.........
b. assign a = &b;
if (a)
.........
Thanks in advance!
Jeff
I have few questions on the verilog coding style.
Which is better in term of speed/area for synthesis?
Question 1:
a. I can create some small functions such as a function that will do add, a function that will do multiplication. So that every time when I need to do some multiplication (example), i can just call this function.
b. Or I can do the multiplication/addition simply in the code without using functions.
Question 2 (related to question 1):
a. Use function.
b. Use submodule.
Question 3:
a. always @(posedge clk)
a <= b + c;
b. assign d <= b + c;
always @(posedge clk)
a <= d;
Question 4:
a. if (b == 3'b111)
.........
b. assign a = &b;
if (a)
.........
Thanks in advance!
Jeff