×
嵌入式开发 > 详情

如何在SoC设计中使用事务处理(二)

发布时间:2020-07-02 发布时间:
|

建模、验证与调试需要统一标准的符号和框架,以便使架构师和设计工程师能够协同进行复杂SoC的开发。事务处理级模型(TLM)是进行这种分析的理想模型,在片上系统(SoC)设计使用事务处理级建模,可让设计从高效率协同仿真和高产出的分析与调试中受益。

下面是对图2所示的事务处理进行建模的一个简单代码段。这个类的旨在于将事务处理数据记录到作为trans_db instance dump_file类的事务处理数据库中。输出被显示在图3最右部分。

// Inside program or some other OpenVera context

trans_db dump_file;

trans_stream stream1;

trans_type mem_read;

trans_handle h1;

// open a database file

dump_file=new(test);

// create the memory stream under the test.duv.bus scope

stream1=new(dump_file, test.duv.bus, memory);

// create the read transaction type in the memory stream

mem_read=new(stream1, Read);

// define 2 attributes in the read transaction type

mem_read.create_attr(Addr, INTEGER_DT);

mem_read.create_attr(Data, INTEGER_DT);

delay(10);

// begin a memory read transaction at 10

h1=mem_read.begin_now();

h1.log_integer_attr(Addr, 170);

h1.log_integer_attr(Data, 123);

delay(20);

// end h1 transaction at 20

h1.end_now();

// close the database file

dump_file.close();



『本文转载自网络,版权归原作者所有,如有侵权请联系删除』

热门文章 更多
PLC控制步进电机方法