了解SystemC中的类型

我是SystemC编程的初学者,我注意到了一件事(查看SystemC官方文档):我在VHDL模拟中处理的所有类型都没有“移植”到SystemC。 我的意思是: 考虑VHDL标准库中的
std_logic
,SystemC中没有等效的,但是,在SystemC文档中,我看到很多使用
bool
的例子。 考虑
std_logic_vector
,我看不到SystemC中的等价物。相反,在很多例子中,我可以看到
sc_int
的用法。 所以我认为SystemC不提供类型来管理单个位或电信号,但它提供了更高的抽象,就像在每个常见的C / C ++应用程序中一样。 是这样还是我错过了什么?     
已邀请:
     考虑vhdl标准库中的
std_logic
,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);
    }
}
希望有所帮助。     
它确实有一些类型:
sc_int
sc_bv
(bitvector)等。     

要回复问题请先登录注册