在线咨询 切换到宽版
eetop公众号 创芯大讲堂 创芯人才网

 找回密码
 注册

手机号码,快捷登录

手机号码,快捷登录

搜帖子
查看: 2317|回复: 4

[讨论] 这个interrupt controller 怎么写stimulus?

[复制链接]
发表于 2018-7-17 09:32:37 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?注册

×
自己拿来练手的。

interrupt有16个interrupt source(0~15)
每个source有3bit的interrupt priority(0~7,越低优先级越高)
每个source有一个soft_int_en, 可以选soft_int还是hardware interrupt
每个source有一个mask,如果为一就不会响应这个source的interrupt

总的有一个mask,如果为一就不会有任何interrupt产生。
总的还有一个nest_en,如果为0,就不会在interrupt响应期间产生新的interrupt, 如果为1,就允许产生nested interrupt
总的还有一个nest_level,如果nest 的interrupt数目小于nest level,就允许产生新的interrupt,否则就不会有新的interrupt

我的想法是
class int_source;
  rand bit int_src;
  rand bit soft_int_src;
  rand bit soft_int_en;
  rand bit mask;
  rand bit [2:0] priority;
endclass

class int_packet;
  rand int_source int_src;
  rand bit  general_mask;
  rand bit  nest_en;
  rand bit  nest_level;
endclass
这样写有问题吗?还是有更好的写法?准备用UVM testbench。
发表于 2018-7-17 15:26:48 | 显示全部楼层
是不是应该用int_cfg和int_event来更好一点,cfg中存放配置相关的内容,比如mask,enable等,event中用来记录中断事件,最好加上时间参数,另外考虑一下中断时间要不要记录,以及执行的中断函数等;
另外需要考虑怎么优化中断控制器,中断嵌套如何处理。
回复 支持 反对

使用道具 举报

 楼主| 发表于 2018-7-17 16:44:49 | 显示全部楼层
如果把“cfg"和“event”分在两个class中,概念上更清楚,但对implementation来说会不会更麻烦?
记录的话会用monitor,觉得没必要。
时间参数没概念,可以具体一点吗?
回复 支持 反对

使用道具 举报

发表于 2018-7-20 14:27:53 | 显示全部楼层
这样写理论上也可以了。至于2楼说的方式无非就是考虑把cfg和event分开,用两个constraint亦可实现
回复 支持 反对

使用道具 举报

发表于 2018-7-22 07:17:04 | 显示全部楼层
Create field class, register class and collection of interrupt register class like uvm reg structure, only difference is field class needs priority and mask.
Create a interrupt interface too. Along with that write a seqcr and seq for reg reading and clearing after read.
In the env, run_phase, wait for interrupt to assert, and execute the read sequence then clear seqeuce.
This will execute on register model for all the registers and trigger respective field events
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

关闭

站长推荐 上一条 /1 下一条


手机版| 小黑屋| 关于我们| 联系我们| 隐私声明| EETOP 创芯网
( 京ICP备:10050787号 京公网安备:11010502037710 )

GMT+8, 2025-8-19 12:19 , Processed in 0.013274 second(s), 4 queries , Gzip On, Redis On.

eetop公众号 创芯大讲堂 创芯人才网
快速回复 返回顶部 返回列表