Method: RCSimCinterface.rcsim_main

Defined in:
ext/hruby_sim/hruby_rcsim_build.c

.rcsim_main(systemTV, name, outmodeV) ⇒ Object

Starts the C-Ruby hybrid simulation. @param systemTV the top system type. @param name the name of the simulation. @param outmode tells which output mode is used: 0: standard 1: mute 2: vcd



1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
# File 'ext/hruby_sim/hruby_rcsim_build.c', line 1734

VALUE rcsim_main(VALUE mod, VALUE systemTV, VALUE name, VALUE outmodeV) {
    /* Get the C system type from the Ruby value. */
    SystemT systemT;
    value_to_rcsim(SystemTS,systemTV,systemT);
    /* Set it as the top of the simulator. */
    top_system = systemT;
    /* Enable it. */
    set_enable_system(systemT,1);
    /* Get the output mode. */
    int outmode = NUM2INT(outmodeV);
    /* Starts the simulation. */
    switch(outmode) { 
        case 0: hruby_sim_core(StringValueCStr(name),init_default_visualizer,-1);
                break;
        case 1: hruby_sim_core(StringValueCStr(name),init_mute_visualizer,-1);
                break;
        case 2: hruby_sim_core(StringValueCStr(name),init_vcd_visualizer,-1);
                break;
        default:hruby_sim_core(StringValueCStr(name),init_default_visualizer,-1);
    }
    return systemTV;
}