当前位置:网站首页>dsp和fpga的通讯
dsp和fpga的通讯
2022-07-28 05:23:00 【weixin_41950112】
之前一直好奇DSP和FPGA的地址怎么对应过去的。
(1):先配置好管脚:
void InitXintf16Gpio() //16位;
{
EALLOW;
GpioCtrlRegs.GPCMUX1.bit.GPIO64 = 3; // XD15
GpioCtrlRegs.GPCMUX1.bit.GPIO65 = 3; // XD14
GpioCtrlRegs.GPCMUX1.bit.GPIO66 = 3; // XD13
GpioCtrlRegs.GPCMUX1.bit.GPIO67 = 3; // XD12
GpioCtrlRegs.GPCMUX1.bit.GPIO68 = 3; // XD11
GpioCtrlRegs.GPCMUX1.bit.GPIO69 = 3; // XD10
GpioCtrlRegs.GPCMUX1.bit.GPIO70 = 3; // XD19
GpioCtrlRegs.GPCMUX1.bit.GPIO71 = 3; // XD8
GpioCtrlRegs.GPCMUX1.bit.GPIO72 = 3; // XD7
GpioCtrlRegs.GPCMUX1.bit.GPIO73 = 3; // XD6
GpioCtrlRegs.GPCMUX1.bit.GPIO74 = 3; // XD5
GpioCtrlRegs.GPCMUX1.bit.GPIO75 = 3; // XD4
GpioCtrlRegs.GPCMUX1.bit.GPIO76 = 3; // XD3
GpioCtrlRegs.GPCMUX1.bit.GPIO77 = 3; // XD2
GpioCtrlRegs.GPCMUX1.bit.GPIO78 = 3; // XD1
GpioCtrlRegs.GPCMUX1.bit.GPIO79 = 3; // XD0
GpioCtrlRegs.GPBMUX1.bit.GPIO40 = 3; // XA0/XWE1n
GpioCtrlRegs.GPBMUX1.bit.GPIO41 = 3; // XA1
GpioCtrlRegs.GPBMUX1.bit.GPIO42 = 3; // XA2
GpioCtrlRegs.GPBMUX1.bit.GPIO43 = 3; // XA3
GpioCtrlRegs.GPBMUX1.bit.GPIO44 = 3; // XA4
GpioCtrlRegs.GPBMUX1.bit.GPIO45 = 3; // XA5
GpioCtrlRegs.GPBMUX1.bit.GPIO46 = 3; // XA6
GpioCtrlRegs.GPBMUX1.bit.GPIO47 = 3; // XA7
GpioCtrlRegs.GPCMUX2.bit.GPIO80 = 3; // XA8
GpioCtrlRegs.GPCMUX2.bit.GPIO81 = 3; // XA9
GpioCtrlRegs.GPCMUX2.bit.GPIO82 = 3; // XA10
GpioCtrlRegs.GPCMUX2.bit.GPIO83 = 3; // XA11
GpioCtrlRegs.GPCMUX2.bit.GPIO84 = 3; // XA12
GpioCtrlRegs.GPCMUX2.bit.GPIO85 = 3; // XA13
GpioCtrlRegs.GPCMUX2.bit.GPIO86 = 3; // XA14
GpioCtrlRegs.GPCMUX2.bit.GPIO87 = 3; // XA15
GpioCtrlRegs.GPBMUX1.bit.GPIO39 = 3; // XA16
GpioCtrlRegs.GPAMUX2.bit.GPIO31 = 3; // XA17
GpioCtrlRegs.GPAMUX2.bit.GPIO30 = 3; // XA18
GpioCtrlRegs.GPAMUX2.bit.GPIO29 = 3; // XA19
//GpioCtrlRegs.GPBMUX1.bit.GPIO34 = 3; // XREADY
//GpioCtrlRegs.GPBMUX1.bit.GPIO35 = 3; // XRNW
GpioCtrlRegs.GPBMUX1.bit.GPIO38 = 3; // XWE0
GpioCtrlRegs.GPBMUX1.bit.GPIO36 = 3; // XZCS0
GpioCtrlRegs.GPBMUX1.bit.GPIO37 = 3; // XZCS7
//GpioCtrlRegs.GPAMUX2.bit.GPIO28 = 3; // XZCS6
EDIS;
}
每一个管教配置为数据总线的哪一位其实都已经被确定死了的。比如管脚79只能配置为数据位的0号为,地址线也是,至于要使用多少位的地址线,这是自由,但是通常来讲数据位应当是16位的,或者32位的数据。这里就确定了DSP的接线了。当给地址区域0的一号位(0x004000)写数据的时候,由于同一寻址的原因会DSP会给0x00 0000也就是给每个地址总线低电位,而不是实际的(0x00 4000)直接进行输出到地址总线。
(2)下面是FPGA的接线,在pin_planner中进行管脚安排。

管脚安排如下:
在FPGA中定义了地址向量将地址0给管脚28,将地址管脚1给25,诸如此类。

最后将执行写指令,将数据写入到memory()当中。
这样就完成了将DSP中的地址0x00400(0号地址)的变量传递给到FPGA的memory(0)当中的通信。
(3)继续写关于载波如何同步的
if(memory(0)=0)then --clear ready signal;
ready<=0;
end if;
if(memory(0)=1)then --set ready signal;
ready<=ready+1;
elsif(ready=1)then
ready<=2;
end if;
if((we='1')and(memory(0)=1))then
memory(0)<=0;
end if;
初始化后memory(0)=0;ready=0;当memory等于1,也就是DSP发过来了同步信号时候,ready=1;这一步触发两个并行进程,又进一步变化为2(由于并行触发,防止进一步触发其他信号),在下一步将memory置0,再就是将ready置0,形成一个闭环。
if(clk'event and clk='1')then
--载波起始数据更新
if(ready=1)then
sector<=memory(2);
t1<=memory(3);--dap
t2<=memory(4);--dbp
mode<=memory(5);
t3<=memory(6);--dan
t4<=memory(7);--dbn
end if;
以及下面的:
begin
if(reset='0')then
count<=0;
elsif(clk'event and clk='1')then
if(ready=1)then
count<=0;
elsif(count>=(ts-1))then
count<=(ts-1);
else
count<=count+1;
end if;
end if;
(4)编程过程出现错误:Error (10531): VHDL Variable Declaration error at basic.vhd(56): variable declared outside subprogram or process must be a shared variable
这里由于对VHDL中的variable 和signal 理解不到位的原因。我直接定义在

这里是不能在architecture中定义变量的。这也就验证了,这里的signal 将链接几个进程,一旦发生改变将触发多个变量,这是signal 和 variable 的区别。
(5)多个vhdl实体时间的配合:

以count为例子,在一个实体中对count进行计数,但是在另外一个PWM.vhd中进行PWM中的生成。怎么进行调用呢。这需要在计数实体当中,设置count为输出端口,在PWM.vhd实体当中将count设置为输入端口。
边栏推荐
- 1、 Amd - openvino environment configuration
- 基于差值扩展的可逆水印方法
- Why is the kotlin language not popular now? What's your opinion?
- 深度学习(增量学习)——(ICCV)Striking a Balance between Stability and Plasticity for Class-Incremental Learning
- 三、OpenVINO实战:图像分类
- What are the points for attention in the development and design of high-end atmospheric applets?
- 无约束低分辨率人脸识别综述一:用于低分辨率人脸识别的数据集
- ESXi on ARM v1.2 (2020年11月更新)
- 使用PowerCli来创建自定义ESXi ISO镜像
- Model Inversion Attacks that Exploit Confidence Informati on and Basic Countermeasures 阅读心得
猜你喜欢

Geek challenge 2019-sql injection five questions PW

基于选择性知识提取的野外低分辨率人脸识别的论文阅读笔记

ESXi on Arm 10/22 更新

Latex入门

What about the app store on wechat?

Overview of unconstrained low resolution face recognition II: heterogeneous low resolution face recognition methods

关于Fusion on Apple Silicon的谨慎猜测

Which enterprises are suitable for small program production and small program development?

Apache log4j arbitrary code execution replication

The number of password errors during login is too many, and the user is blocked,
随机推荐
Cluster operation management system, to answer questions about the process
基于差值扩展的可逆水印方法
USB Network Native Driver for ESXi更新到支持ESXi7.0 Update 2
ESXi on ARM v1.2 (2020年11月更新)
弹出消息对话框的方法
Common CTF encryption methods JS
Geek challenge 2019-sql injection five questions PW
VB-ocx应用于Web
《Distilling the Knowledge in a Neural Network》知识蒸馏论文解读
RS232 RS485 RS422 通信 学习及备忘笔记
电快速脉冲群(EFT)设计-EMC系列 硬件设计笔记4
Difference between shallow copy and deep copy
Deep learning - patches are all you need
机群作业管理系统,求解答进程方面的疑问
Deep learning (self supervision: Moco V2) -- improved bases with momentum contractual learning
二、OpenVINO简述与构建流程
详解爬电距离和电气间隙
利用辅助未标记数据增强无约束人脸识别《Boosting Unconstrained Face Recognition with Auxiliary Unlabeled Data》
Deep learning (self supervision: simple Siam) -- Exploring simple Siamese representation learning
Overview of unconstrained low resolution face recognition III: homogeneous low resolution face recognition methods