cnt.cpp
来自「VHDL to System C translator」· C++ 代码 · 共 29 行
CPP
29 行
#include "cnt.h"
#ifdef MTI_SYSTEMC
SC_MODULE_EXPORT(cnt);
#endif
void cnt::process_line37() {
if (reset.read() == 1) {
count_s.write((sc_uint<3>)("0b000"));
} else
if (clk.posedge()) {
if (updown.read() == 1) {
count_s.write((sc_uint<3>)(count_s.read() + 1 ));
} else {
count_s.write((sc_uint<3>)(count_s.read() - 1 ));
}
}
if (!!((count_s.read() == 7))) SC_REPORT_FATAL("","Counter Overflow");
}
void cnt::comb_assignments() {
count.write((sc_uint<3>)(count_s.read() ));
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?