?? tb_vco.cpp.bak
字號:
#include "systemc-ams.h"
#include "vco.h"
SCA_SDF_MODULE(src_ctrl) {
sca_sdf_out<double> out;
void init () {
out.write(0.0);
}
void sig_proc() {
double now = sc_time_stamp().to_seconds();
if (now < 5.0e-5) out.write(-5.0);
else if (now < 1.0e-4) out.write(+5.0);
else out.write(0.0);
}
SCA_CTOR(src_ctrl) {}
}; // src_ctrl
SCA_SDF_MODULE(trace)
{
sca_sdf_in<double> in;
ofstream output;
void sig_proc() {
output << sc_time_stamp().to_seconds() << "\t " << in.read() << endl;
}
SCA_CTOR(trace) {
output.open(name(), ios::out);
}
};
int sc_main(int argc, char* argv[])
{
sca_sdf_signal<double> ctrl, vcoo;
sc_set_time_resolution(0.01, SC_US);
vco i_vco ("vco");
i_vco.in(ctrl);
i_vco.out(vcoo);
i_vco.gain = 2.5;
i_vco.kvco = 1e5;
i_vco.fc = 1e6;
i_vco.vfc = 0.0;
src_ctrl i_src("src_ctrl");
i_src.out(ctrl);
i_src.out.set_delay(1);
i_src.out.set_T(sc_time(0.01, SC_US));
trace tr_ctrl("tr_ctrl"); tr_ctrl.in(ctrl);
trace tr_vcoo("tr_vcoo"); tr_vcoo.in(vcoo);
sc_start(140, SC_US);
return 0;
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -