OpenCores学习(4)--接口与NODE

第四章和第五章就是些介绍,只是把关键的语句翻译出来,见谅。

从第六章开始很关键,我也会尽量全部翻译过来。

4.接口

4.1默认接口

      PVPlayer的接口是标准的OSCL-based 接口,引擎的API都是通过这些接口来调用相对应的操作,但是像一些OSCL类型的组件和PVMF类型的组件里需要注意有些不同.

 4.2 适配层

       the interface to PVPlayer SDK needs to be different than the OSCL-based interface, another interface layer needs to be created to “wrap” around the OSCL-based interface. This “wrapper” is referred to as an

 adaptation layer for OSCL-based PVPlayer engine interface.One possible reason to create an adaptation layer would be to encapsulate the OSCL interface with types and components of a particular platform or operating system (e.g. ANSI C interface, Symbian interface).Another reason would be that the adaptation layer modifies the interface and behavior of PVPlayer SDK to match the expectation of the application (e.g. legacy interface). The adaptation layer could also combine PVPlayer SDK with another SDK or component to provide a unified interface to the application.The block diagrams below illustrate how the adaptation layer relates to PVPlayer Engine and its OSCL-based interface. The diagram on the right shows the adaptation layer adding more functionality by including another engine.

OpenCores学习(4)--接口与NODE

                                   图四    适配层

4.3 多线程支持

        默认的OSCL-based 接口不支持多线程,所以在使用多线程的时候,适配层需要提供一个功能来实现.一种方法是使用OSCL proxy 接口组件来提供多线程的支持.另一种方法是添加一个另外的Platform Threading Support.两种方法的框图如下.

4.4  媒体数据输出到数据池

 PVPlayer引擎利用PVMF节点指定数据输出的数据池,但大部份使用的时候,同步数据通过适合的渲染后再送到媒体输出设备.在输出视频流的时候,需 要一个显示设备,音频流需要一个PCM 音频输出设备.媒体输出设备是一个具体的特定平台.输出设备的创建有两个方法可以实现:

 (1)在PVMF节点里封装一个media device,引擎可以直接调用,这种方法可以最大限度的减少PVPlayer和接口层的代码,但是需要创建一个新的PVMF节点.

  (2)直接调用PV media I/O接口,在I/O接口中调用输出设备.这种方法相对于第一种来说并不需要创建新的PVMF节点,复杂性也小.但增加了代码的层次和和代码量.下图是两 种方法的引擎.更多PV I/O接口的信息,参考PV MEDIA I/O datasheet.

   

OpenCores学习(4)--接口与NODE

                          图 6 媒体输出的两种方法

5. PVMF Node

       本节给出PVMF简短的描述节点,由PVPlayer引擎使用。只有PVMF节点OSCL和PVMF 基于组件都包括在内。没有特定于平台PVMF节点覆盖。欲了解更多有关特定节点(1,低于或平台特定一)的详细信息,请参阅该节点文件。

5.1 数据池节点(Data Sink Nodes)

       数据池节点是PVPlayer的引擎中输出数据前最后的数据终点.

5.1.1 PVMFMediaOutputNode

       PVMFMediaOutputNode is a wrapper node around the PV media I/O interface to output data. The node translates node commands and incoming media data to appropriate media I/O actions and handles media I/O events. Using PVMFMediaOutputNode allows encapsulation of platform and device specific output interface with PV media I/O interface.

5.1.2 PVMFFileOutputNode

       PVMFFileOutputNode accesses the file directly using OSCL file I/O to write media data coming in via the port. The node has some capability to understand format type and to write out data appropriately for the specified format type (AMR file header for AMR IETF format).

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
最近一个项目需要做I2C的slave,在opencores.org上面找到了一个I2C的代码,不过是master的。 下载来看看,发现里面有一个I2C slave的行为级代码。 于是自己根据这个代码改写了一个I2C slave RTL的代码,并修改了原来那个设计的testbench,将rtl的Slave替换了原来的behavior的Slave,在modelsim里面作了前仿,完全通过。还有一个myram.v文件,是一个register file,和slave相连,存储数据用的。 用synplify做综合,使用x3s400-4的器件,占用LUT<100,速度接近200MHz。性能比较优化。 代码做了详尽的注释,语言采用verilog,并且写了仿真的脚本。解压了直接运行simbehav.bat就可以了。如果modelsim安装的时候注册了环境变量(path),脚本调用modelsim,输入run -all即可看到仿真结果。 虽然不是很复杂,不过对于广大需要做I2C的RTL slave的工程师来说,还是很有参考价值的。 1、 设计流程 将I2C slave的行为模型改为rtl模型。 进行等效仿真,直到波形一致,通过timing check,数据正确。 再进行rtl优化设计 2、 注意要点 a) 时钟的设计 b) 对于restart condition的时序是否正确 c) 3、 进度 a) 11-12:initial状态的bitcnt不对,需要认真比对/设计 b) 11-13:initial基本解决(sda_in的问题)。Sda三态冲突,原因不明。比对原设计 c) 11-14:sda三态冲突解决,原因为sda在初始化时没有将sda_oen赋值(由sm赋值,但是sm没有做async reset)。同时注意verilog的大小写敏感。 d) 11-15:仿真出现错误:read出来的数据非期望值。写入逻辑完全正确。Read时由于sda_oe在sm中有一个cycle_pulse的延迟,导致了mem_do[7]串行移出时错位。在更改了sm的代码风格后再研究解决方法。 e) 11-16:仿真完全匹配波形。计划:优化结构,提高稳定性sm改为每个时钟打一下。 关于I2C的SDA三态转换: Master在发送完第8个bit后随后将sda释放(posedge后大概1/4 scl周期),此时slave需要在第九个bit对应的scl的posedge拉低sda。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值