⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 cordic.cpp

📁 VHDL to System C translator
💻 CPP
字号:
#include "cordic.h"

#ifdef MTI_SYSTEMC
SC_MODULE_EXPORT(cordic);
#endif


void cordic::process_line90() {
    sc_uint<32> xreg_s_sliced;
    xreg_s_sliced=xreg_s.read();
    if (clk.posedge()) {
        if (init_s.read() == 1) {
            xreg_s_sliced(31,0)=xinit_c ;
        } else
            if (load_s.read() == 1) {
                xreg_s_sliced=(sc_uint<32>)(newx_s.read() );

            }
    }
    xreg_s.write(xreg_s_sliced);

}
void cordic::process_line100() {
    if (clk.posedge()) {
        if (init_s.read() == 1) {
            yreg_s.write((sc_uint<32>)(yinit_c ));
        } else
            if (load_s.read() == 1) {
                yreg_s.write((sc_uint<32>)(newy_s.read() ));

            }
    }
}
void cordic::process_line110() {
    if (clk.posedge()) {
        if (init_s.read() == 1) {
            zreg_s.write((sc_uint<32>)(angle.read() ));
        } else
            if (load_s.read() == 1) {
                zreg_s.write((sc_uint<32>)(newz_s.read() ));

            }
    }
}
void cordic::process_line121() {
    if (clk.posedge()) {
        if (init_s.read() == 1) {
            cnt_s.write((sc_uint<5>)("0b00000"));
        } else
            if ((load_s.read() == 1)) {
                cnt_s.write((cnt_s.read() + 1) );

            }
    }
}
void cordic::comb_assignments() {

    nas_s.write((bool)(!(as_s.read()) ));
    as_s.write((bool)(zreg_s.read()[31 ] ));
    sin.write((sc_uint<32>)(yreg_s.read() ));
    cos.write((sc_uint<32>)(xreg_s.read() ));

}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -