是否可以在modelsim中创建IP地址基数?

时间:2013-02-13 11:09:14

标签: modelsim

无论如何都要在波形窗口中以十进制虚线格式显示IP地址字?

1 个答案:

答案 0 :(得分:1)

据我所知,不是...... 但是你可以为4个部分创建虚拟信号('虚拟信号......') 将它们显示为十进制(' - radix unsigned') 并创建一个包含这4个虚拟信号的组('add wave ... -group ...)。

我发现在GUI中更容易创建虚拟信号和组,然后在DO文件中自行输入(“工具” - >“虚拟构建器”)。

测试VHDL文件:

library ieee;
use ieee.std_logic_1164.all;

entity test is
end entity test;

architecture rtl of test is
    signal ip : std_logic_vector(31 downto 0) := x"AC_10_41_3D";  -- 172.16.65.61
begin  -- architecture rtl
end architecture rtl;

wave.do文件的重要部分:

quietly virtual signal -install /test { /test/ip(31 downto 24)} ip_3
quietly virtual signal -install /test { /test/ip(23 downto 16)} ip_2
quietly virtual signal -install /test { /test/ip(15 downto 8)} ip_1
quietly virtual signal -install /test { /test/ip(7 downto 0)} ip_0
add wave -noupdate /test/ip; # without formatting
# group the 4 parts of the IP address and display them as decimal
add wave -noupdate -expand -group {IP_formatted} -radix unsigned /test/ip_3
add wave -noupdate -expand -group {IP_formatted} -radix unsigned /test/ip_2
add wave -noupdate -expand -group {IP_formatted} -radix unsigned /test/ip_1
add wave -noupdate -expand -group {IP_formatted} -radix unsigned /test/ip_0
相关问题