我是靠谱客的博主 轻松猎豹,最近开发中收集的这篇文章主要介绍Chapter 12 -- SystemC From Gound 读书心得,觉得挺不错的,现在分享给大家,希望可以做个参考。

概述

Standard Interface

1.  FIFO interface

     sc_fifo<T> channel 由 sc_fifo_in_if<T> 以及 sc_fifo_out_if<T>扩展而来。所谓interface的out于in是相对于module的port而言的。sc_fifo_in_if<T>提供了所有的从FIFO输入到module的纯虚函数。而sc_fifo_out_if<T>提供了所有的从module输出到FIFO的纯虚函数。其中read和write函数是blocking的(FIFO空或满时等待)

 

 

2. Signal Interface

    类似的,sc_signal<T> channel由两个interface扩展而来。sc_signal_in_if<T>,sc_signal_inout_if<T>.

   

 

3. Sensitivity and Event finder

    sensitive list 中可以是event,我们很期待SC_METHOD process 能够被channel中定义事件触发。但是channel中的event不能直接放在sensitive list中,因为我们知道port指向了这些channel,这就意味着sensitive list中有port->xxx_event. 而port在此时 处于未定义。

    systemc 的event finder解决了这个问题。sc_event_finder 将actual event的判定拖后到elaboration结束之后。

   

    channel中常有的event是 data_write_event, posedge_event, value_changed_event, default_event.

 

    如果嫌sc_event_finder使用起来麻烦,那么systemc已经定义好了一些template specialized ports。这些ports由sc_port扩展而来,并且包括了event finder。使用时只要用这些specialized port代替general的port就行了。

 

GUIDELINE: Use dot (.) in the elaboration section of the code, but use arrow (->) in processes.

 

GUIDELINE: To avoid confusion, never use the assignment operator with sc_signal<T> or  

sc_port<sc_signal_inout_if<T> >. Instead, usethe write() method.

 

有哪些specialized port?

   sc_in, sc_out, sc_inout, sc_inout_resolved, sc_inout_rv, sc_fifo_in, sc_fifo_out. 一般都是这种形式xxx_in, xxx_out.

 

4. Port Array and Policy

    port array 允许产生一堆相同的port。 port Policy规定了是否至少有一个port,或全部port必须连接起来。或者都可以不连。

 

 

 例如:

  

 

5. sc_export<T>是为了把channel放入到设计的module(即开发的IP)的内部,这样就隐藏了一些连接的细节。使用的时候这个sc_export<T>就像一个channel。有点类似于一个pin脚,它拉到了模块的管脚上,但是default是不可见的。只有debug的时候是可见的。

 

 

最后

以上就是轻松猎豹为你收集整理的Chapter 12 -- SystemC From Gound 读书心得的全部内容,希望文章能够帮你解决Chapter 12 -- SystemC From Gound 读书心得所遇到的程序开发问题。

如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(54)

评论列表共有 0 条评论

立即
投稿
返回
顶部