- 考虑
std_logic在 vhdl 标准库中,SystemC 中没有等效项,但是,在 sysc 文档中,我看到许多使用bool.
- 考虑一下
std_logic_vector,我在 sysc 中看不到等价物。相反,在许多示例中,我可以看到sc_int.
这并不是那么正确。
在 SystemC 中,您可以分别使用sc_logic和sc_lv< T >作为std_logic和std_logic_vector。
您可以分配给SC_LOGIC_0或SC_LOGIC_1文字给sc_logic。
虽然您可以使用整数、十六进制甚至“特定于位”的文字来分配sc_lv< T >值。
例如:
class some_device : sc_module
{
sc_out< sc_lv<32> > address;
sc_out< sc_logic > write_enable;
SC_CTOR (some_device)
{
write_enable.initialize(SC_LOGIC_0);
/* The following three lines do the same thing.
* Obviously you won't use all three at the same time... */
address.initialize(0b00001111000011110000111100001111);
address.initialize(0x0F0F0F0F);
address.iniziatize(252645135);
}
}
希望有帮助。