【发布时间】:2018-06-21 16:50:51
【问题描述】:
例如,我想在 Testbench 中创建一个字符串列表来加载不同的文件。
我试过了:
type tastring ARRAY(iADCCount_C-1 downto 0) of string;
constant Filenames : tastring := ("file.txt",
"anotherfile.txt",
"jetanotherfile.txt");
数组中不可能有可变长度的字符串。
还有:
type tpstring is access string;
type tpastring is ARRAY(iADCCount_C-1 downto 0) of tpstring;
constant Filenames : tpastring := (new string'("file.txt"),
new string'(anotherfile.txt"),
new string'(jetanotherfile.txt"));
不工作!您不能将访问类型设为常量。我错过了什么吗?有没有办法在不将它们填充到相同大小的情况下制作一个字符串列表?
【问题讨论】:
-
另请参阅此问题的答案:VHDL Port declaration with different sizes
标签: arrays string constants vhdl string-length