新闻中心

EEPW首页 > 嵌入式系统 > 设计应用 > 如何在SoC设计中使用事务处理(二)

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

作者:时间:2012-08-01来源:网络收藏

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

本文引用地址:http://www.eepw.com.cn/article/148679.htm

下面是对图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();


上一页 1 2 下一页

评论


相关推荐

技术专区

关闭