verilog int unsigned vhdl等效

发布于 2025-01-17 22:37:30 字数 215 浏览 0 评论 0原文

我想访问 VHDL 中的 Verilog 模块。其中,Verilog 模块具有输入参数:

parameter int unsigned RST_CYC = 100_000;

以下内容是否与映射的正确 VHDL 等效?

constant RST_CYC : unsigned := d"100_000";

I would like to access a Verilog module within VHDL. Among others, the Verilog module has the input parameter:

parameter int unsigned RST_CYC = 100_000;

Is the following the correct VHDL equivalent for mapping?

constant RST_CYC : unsigned := d"100_000";

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

剪不断理还乱 2025-01-24 22:37:30

我建议坚持使用整数(或自然数,即不能为负数的整数)。所以在这种情况下:

constant RST_CYC : natural := 100000;

声明一个信号将如下所示:

signal rst_count : integer range 0 to RST_CYC;

如果可以的话,坚持使用整数。如果您需要转换为 unsignedstd_logic_vector 那么您可以执行以下操作:

unsigned_val <= to_unsigned(rst_count, unsigned_val'length);

I recommend sticking with integers (or naturals, which are integers that can't go negative). So in this case:

constant RST_CYC : natural := 100000;

Declaring a signal would look like this:

signal rst_count : integer range 0 to RST_CYC;

Stick with integers if you can. If you NEED to convert to unsigned or std_logic_vector then you can do something like:

unsigned_val <= to_unsigned(rst_count, unsigned_val'length);
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文