主要参考ug479.pdf。之前的文章:FIR调用DSP48E_05。本文主要记录基本用法。
一、DSP48核
A-参数说明
- instrctions,多个功能,通过sel选用
目前没发现C勾选与否,有何影响。
如上图所示,结果3拍后输出:
其他参数:
B-IP调用
生成IP核,参数设置完毕直接调用即可
dsp48_ex dsp_inst( .CLK(clk), .A(a), .B(b), .C(c), .P(p) );
二、原语示例
主要参考pg148-dsp48 macro.pdf用到再细化补充。
Ex1:
// m = b * (a + d)
// p = c+m or p+m
`timescale 1ns / 1ps // m = b * (a + d) // p = c+m or p+m module dsp48_wrap_f ( input clock, input ce1, input ce2, input cem, input cep, input signed [24:0] a, input signed [17:0] b, input signed [47:0] c, input signed [24:0] d, // this has two fewer pipe stages // X+Y is usually the multiplier output (M) // Z is either P, PCIN or C // bit 1:0: 0: Z+X+Y 3:Z-(X+Y) 1: -Z + (X+Y) 2: -1*(Z+X+Y+1) // bits 3:2, 0: Z=0, 1: Z=PCIN, 2: Z=P, 3: Z = C // bit 4: sub in pre add input [4:0] mode, input signed [47:0] pcin, output signed [47:0] pcout, output signed [47-S:0] p); parameter S = 0; parameter US