图5 乘法器原语的示意图
在ISE中打开Language-template,verilog— device primitive--- Spartan3--- Arithmetic functions, 就可以看到MULT18*18和MULT18*18S的原语调用代码了。例如MULT18*18的就是
// MULT18X18 : In order to incorporate this function into the design,
// Verilog : the following instance declaration needs to be placed
// instance : in the body of the design code. The instance name
// declaration : (MULT18X18_inst) and/or the port declarations within the
// code : parenthesis may be changed to properly reference and
// : connect this function to the design. All inputs
// : and outputs must be connected.
// <-----Cut code below this line---->
// MULT18X18: 18 x 18 signed asynchronous multiplier
// Spartan-3
// Xilinx HDL Language Template, version 12.1
MULT18X18 MULT18X18_inst (
.P(P), // 36-bit multiplier output
.A(A), // 18-bit multiplier input
.B(B) // 18-bit multiplier input
);
// End of MULT18X18_inst instantiation
前面已经介绍了Spartan3系列FPGA中硬件乘法器的用途、调用方法、结构特定等等,对Xilinx FPGA中基本的硬核乘法器有了初步的认识。接下来对它的一些具体使用方法做更深入的介绍。