May 22

VHDL下类似Verilog #ifdef的语句 不指定

RickySu , 16:58 , 技术经验 , 评论(0) , 引用(0) , 阅读(846) , Via 本站原创 | |
有人问在VHDL下有没有类似#ifdef的语句,可不可以认为configuration和verilog的 #ifdef 类似。

configuration,怎么说,在一定程度上可以,但是由于ISE的支持也不是很全,实际操作中估计比较难应用。

其实VHDL下的更类似 #ifdef 的语句是 generate:

1、定义一个generic,可以从外部传递参数
2、通过if xx = '1' generate xxx 的形式,把 #ifdef 包含的内容写出来

一般在做一个可配置的IP core 的时候比较有用。
EDK里面很多IP都是这样写的。
Tags: , ,
发表评论
表情
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
打开HTML
打开UBB
打开表情
隐藏
记住我
昵称   密码   游客无需密码
网址   电邮   [注册]