提交 db8f3b8a 编写于 作者: 饶先宏's avatar 饶先宏

202108131711

上级 00be60b7
......@@ -99,17 +99,12 @@ int main(int argc, char* argv[])
printf("omp threads=%d, %d, %d\n", omp_get_thread_num(), omp_get_max_threads(), omp_get_num_procs());
#if VCDOUTPUT
vcdfile = hdl4sesimCreateVCDFile("terris.vcd");
objectCall2(vcdfile, AddSignal, "/top/terrisctrl", "bCtrlState");
objectCall2(vcdfile, AddSignal, "/top/terrisctrl", "wCtrlStateComplete");
objectCall2(vcdfile, AddSignal, "/top/terrisctrl", "bCtrlKeyData");
objectCall2(vcdfile, AddSignal, "/top/terrisctrl", "bNewNextBlock");
objectCall2(vcdfile, AddSignal, "/top/terrisctrl/gennewblock", "wirein_nextblock");
objectCall2(vcdfile, AddSignal, "/top/terrisctrl/gennewblock", "setshape");
objectCall2(vcdfile, AddSignal, "/top/terrisctrl/gennewblock", "newshape");
objectCall2(vcdfile, AddSignal, "/top/terrisctrl/gennewblock", "wireout_nextblock");
objectCall2(vcdfile, AddSignal, "/top/terrisctrl/gennewblock", "wireout_shapedata");
objectCall2(vcdfile, AddSignal, "/top/terrisctrl/gennewblock", "newblock");
objectCall2(vcdfile, AddSignal, "/top/terrisctrl/gennewblock", "colorindex");
objectCall2(vcdfile, AddSignal, "/top/terrisctrl/ctrl", "wireout_state");
objectCall2(vcdfile, AddSignal, "/top/terrisctrl/ctrl", "cur_key");
objectCall2(vcdfile, AddSignal, "/top/terrisctrl/ctrl", "wireout_tick");
objectCall2(vcdfile, AddSignal, "/top/terrisctrl/ctrl", "nwReset");
objectCall2(vcdfile, AddSignal, "/top/terrisctrl/ctrl", "bKeyData");
objectCall2(vcdfile, AddSignal, "/top/terrisctrl/ctrl", "wireout_key");
objectCall1(vcdfile, SetTopModule, topmodule);
objectCall0(vcdfile, StartRecord);
......
......@@ -30,7 +30,7 @@
*/
/*
* panelinit.c
* terris_init.c
修改记录:
202106231422: rxh, initial version
202107181520: rxh, macro version
......@@ -49,44 +49,51 @@
#define terris_init_MODULE_VERSION_STRING "0.4.0-20210718.1520 Terris Init module"
#define terris_init_MODULE_CLSID CLSID_TERRIS_INIT
IDLIST
VID(wClk),
VID(bCtrlState),
VID(wCtrlStateComplete),
#define M_ID(id) terris_init##id
VID(wWrite),
VID(bWriteAddr),
VID(bWriteData),
IDLIST
VID(wClk),
VID(bCtrlState),
VID(wCtrlStateComplete),
VID(wInitWrite),
VID(bInitWriteAddr),
VID(bInitWriteData),
VID(ramwriteaddr),
END_IDLIST
MODULE_DECLARE(terris_init)
END_MODULE_DECLARE(terris_init)
DEFINE_FUNC(gen_wCtrlStateComplete, "") {
DEFINE_FUNC(terris_init_gen_bInitWriteData, "") {
VWRITE_U64(bInitWriteData, 0);
} END_DEFINE_FUNC
DEFINE_FUNC(gen_wWrite, "") {
DEFINE_FUNC(terris_init_gen_wInitWrite, "ramwriteaddr, ") {
vput(wInitWrite, vget(ramwriteaddr) <= 24 ? 1 : 0);
} END_DEFINE_FUNC
DEFINE_FUNC(gen_bWriteAddr, "") {
DEFINE_FUNC(terris_init_gen_wCtrlStateComplete, "ramwriteaddr, ") {
vput(wCtrlStateComplete, vget(ramwriteaddr) > 24 ? 1: 0);
} END_DEFINE_FUNC
DEFINE_FUNC(gen_bWriteData, "") {
DEFINE_FUNC(terris_init_gen_bInitWriteAddr, "ramwriteaddr, ") {
VAssign(bInitWriteAddr, ramwriteaddr);
} END_DEFINE_FUNC
MODULE_INIT(terris_init)
PORT_IN(wClk, 1);
PORT_IN(bCtrlState, 4);
PORT_OUT(wCtrlStateComplete, 1);
PORT_OUT(wWrite, 1);
PORT_OUT(bWriteAddr, 6);
PORT_OUT(bWriteData, 64);
DEFINE_FUNC(terris_init_gen_ramwriteaddr, "bCtrlState, ramwriteaddr") {
vput(ramwriteaddr, (vget(bCtrlState) == 0) ? (vget(ramwriteaddr) + 1) : 0);
} END_DEFINE_FUNC
GEN_FUNC("wCtrlStateComplete", gen_wCtrlStateComplete);
GEN_FUNC("wWrite", gen_wWrite);
GEN_FUNC("bWriteAddr", gen_bWriteAddr);
GEN_FUNC("bWriteData", gen_bWriteData);
MODULE_INIT(terris_init)
PORT_IN(wClk, 1);
PORT_IN(bCtrlState, 4);
PORT_OUT(wCtrlStateComplete, 1);
PORT_OUT(wInitWrite, 1);
PORT_OUT(bInitWriteAddr, 6);
PORT_OUT(bInitWriteData, 64);
GREG(ramwriteaddr, 8, terris_init_gen_ramwriteaddr);
GEN_FUNC("bInitWriteData", terris_init_gen_bInitWriteData);
GEN_FUNC("wInitWrite", terris_init_gen_wInitWrite);
GEN_FUNC("wCtrlStateComplete", terris_init_gen_wCtrlStateComplete);
GEN_FUNC("bInitWriteAddr", terris_init_gen_bInitWriteAddr);
END_MODULE_INIT(terris_init)
......@@ -31,7 +31,7 @@
/*
* Created by HDL4SE @ Tue Aug 10 11:07:26 2021
* Created by HDL4SE @ Fri Aug 13 16:00:14 2021
* Don't edit it.
*/
......
......@@ -104,8 +104,6 @@ MODULE_DECLARE(terrisdevice)
unsigned int level; /* 000000f4*/
unsigned int speed; /* 000000f8*/
unsigned int keypressed; /* 00000000 */
END_MODULE_DECLARE(terrisdevice)
......@@ -118,7 +116,7 @@ DEFINE_FUNC(terrisdevice_store_bReadAddr, "bReadAddr") {
} END_DEFINE_FUNC
DEFINE_FUNC(terrisdevice_gen_bReadData, "keypressed") {
VWRITE_U32(bReadData, pobj->keypressed);
VAssign(bReadData, keypressed);
} END_DEFINE_FUNC
static const float blockcolor[16][3] = {
......@@ -246,11 +244,7 @@ int StopRunning();
DEFINE_FUNC(terrisdevice_clktick, "") {
/* 读nwReset信号,看是否复位 */
int reset = VREAD_U32(nwReset);
pobj->keypressed = __keypressed;
if (reset == 0) {
pobj->keypressed = 0;
}
vput(keypressed, pobj->keypressed);
vput(keypressed, __keypressed);
/* 读写命令,看是否写 */
if (reset != 0) {
int wWrite = VREAD_U32(wWrite);
......@@ -360,8 +354,6 @@ MODULE_INIT(terrisdevice)
glfwTerminate();
return -2;
}
pobj->keypressed = 0;
glfwSetWindowAspectRatio(pobj->window, WIDTH, HEIGHT);
glfwSetKeyCallback(pobj->window, key_callback);
......
......@@ -32,7 +32,7 @@
/* panelinit.v */
(*
// HDL4SE="LCOM",
//HDL4SE="LCOM",
CLSID="d6ef2a03-4c58-4b50-a966-44e156694304",
softmodule="hdl4se"
*)
......
......@@ -705,6 +705,8 @@ int hdl4se_var_set_update(ModuleVariable* v)
return 0;
}
#define DEPEND_OPT 1
int hdl4se_module_Setup(sGeneralModule* pobj)
{
int i;
......@@ -723,13 +725,15 @@ int hdl4se_module_Setup(sGeneralModule* pobj)
var->data = var->data_reg;
#endif
var->updatefunc = VUF_UPDATED;
#if DEPEND_OPT
hdl4se_var_set_update(var);
#endif
#if DEBUGDEPEND
printf("\n");
#endif
}
}
#if 0
#if DEPEND_OPT == 0
else if (var->genfuncindex >= 0) {
var->updatefunc = VUF_WAITUPDATE;
}
......
......@@ -73,7 +73,7 @@ END_IDLIST
MODULE_DECLARE(hdl4se_mux16)
END_MODULE_DECLARE(hdl4se_mux16)
DEFINE_FUNC(do_Generate_Result, "sel") {
DEFINE_FUNC(do_Generate_Result, "sel, in0, in1, in2, in3, in4, in5, in6, in7, in8, in9, in10, in11, in12, in13, in14, in15") {
unsigned int sel;
sel = VREAD_U32(sel);
VAssign_idx(17, (sel & 15) + 1);
......
......@@ -59,7 +59,7 @@ END_IDLIST
MODULE_DECLARE(hdl4se_mux2)
END_MODULE_DECLARE(hdl4se_mux2)
DEFINE_FUNC(do_Generate_Result, "sel") {
DEFINE_FUNC(do_Generate_Result, "sel, in0, in1") {
unsigned int sel;
sel = VREAD_U32(sel);
if (sel == 0)
......
......@@ -61,7 +61,7 @@ END_IDLIST
MODULE_DECLARE(hdl4se_mux4)
END_MODULE_DECLARE(hdl4se_mux4)
DEFINE_FUNC(do_Generate_Result, "sel") {
DEFINE_FUNC(do_Generate_Result, "sel, in0, in1, in2, in3") {
unsigned int sel;
sel = VREAD_U32(sel);
VAssign_idx(5, (sel & 3) + 1);
......
......@@ -65,7 +65,7 @@ END_IDLIST
MODULE_DECLARE(hdl4se_mux8)
END_MODULE_DECLARE(hdl4se_mux8)
DEFINE_FUNC(do_Generate_Result, "sel") {
DEFINE_FUNC(do_Generate_Result, "sel, in0, in1, in2, in3, in4, in5, in6, in7,") {
unsigned int sel;
sel = VREAD_U32(sel);
VAssign_idx(VID(data), (sel & 7) + 1);
......
......@@ -238,7 +238,7 @@ static int hdl4sesim_hdl4se_simulator_SetReset(HOBJECT object, int reset)
return 0;
}
#define THREADCOUNT 3
#define THREADCOUNT 4
static int hdl4sesim_hdl4se_simulator_ClkTick(HOBJECT object)
{
......@@ -298,147 +298,88 @@ IHDL4SESimulator** hdl4sesimCreateSimulator()
/*
i5 6200U 2.3G
threadcount=4
clocks: 1867776, TSPD=1361.352770cps, LSPD=2048.000000cps
DEPEND_OPT=1
clocks: 1769472, TSPD=4874.578512cps, LSPD=4681.142857cps
softmax_168 complete
0.4901 n03085013 computer keyboard, keypad
0.1591 n04264628 space bar
0.0543 n04074963 remote control, remote
0.0439 n03832673 notebook, notebook computer
0.0356 n04505470 typewriter keyboard
clocks: 1884160, TSPD=1359.422799cps, LSPD=1170.285714cps
clocks: 1835008, TSPD=4959.481081cps, LSPD=9362.285714cps
clocks: 1802240, TSPD=4681.142857cps, LSPD=4096.000000cps
softmax_168 complete
0.4901 n03085013 computer keyboard, keypad
0.1591 n04264628 space bar
0.0543 n04074963 remote control, remote
0.0438 n03832673 notebook, notebook computer
0.0356 n04505470 typewriter keyboard
clocks: 1818624, TSPD=4687.175258cps, LSPD=5461.333333cps
clocks: 1802240, TSPD=3935.021834cps, LSPD=4096.000000cps
DEPEND_OPT=0
clocks: 1769472, TSPD=3701.824268cps, LSPD=3449.263158cps
softmax_168 complete
0.4901 n03085013 computer keyboard, keypad
0.1591 n04264628 space bar
0.0543 n04074963 remote control, remote
0.0439 n03832673 notebook, notebook computer
0.0356 n04505470 typewriter keyboard
clocks: 1818624, TSPD=3944.954447cps, LSPD=5461.333333cps
clocks: 1835008, TSPD=3707.086869cps, LSPD=3855.058824cps
threadcount=3
clocks : 1867776, TSPD = 1552.598504cps, LSPD = 2048.000000cps
DEPEND_OPT=1
clocks: 1769472, TSPD=6505.411765cps, LSPD=9362.285714cps
softmax_168 complete
0.4901 n03085013 computer keyboard, keypad
0.1591 n04264628 space bar
0.0543 n04074963 remote control, remote
0.0439 n03832673 notebook, notebook computer
0.0356 n04505470 typewriter keyboard
clocks : 1884160, TSPD = 1550.748971cps, LSPD = 1365.333333cps
clocks: 1835008, TSPD=6461.295775cps, LSPD=5461.333333cps
ordered:
clocks: 1867776, TSPD=1312.562193cps, LSPD=1092.266667cps
DEPEND_OPT=0
clocks: 1769472, TSPD=4021.527273cps, LSPD=5957.818182cps
softmax_168 complete
0.4901 n03085013 computer keyboard, keypad
0.1591 n04264628 space bar
0.0543 n04074963 remote control, remote
0.0439 n03832673 notebook, notebook computer
0.0356 n04505470 typewriter keyboard
clocks: 1884160, TSPD=1312.089136cps, LSPD=1260.307692cps
clocks: 1802240, TSPD=4767.830688cps, LSPD=4096.000000cps
softmax_168 complete
0.4901 n03085013 computer keyboard, keypad
0.1591 n04264628 space bar
0.0543 n04074963 remote control, remote
0.0439 n03832673 notebook, notebook computer
0.0356 n04505470 typewriter keyboard
clocks: 1818624, TSPD=4760.795812cps, LSPD=4096.000000cps
clocks: 1802240, TSPD=4353.236715cps, LSPD=5461.333333cps
softmax_168 complete
0.4901 n03085013 computer keyboard, keypad
0.1591 n04264628 space bar
0.0543 n04074963 remote control, remote
0.0439 n03832673 notebook, notebook computer
0.0356 n04505470 typewriter keyboard
clocks: 1818624, TSPD=4350.775120cps, LSPD=4096.000000cps
clocks: 1835008, TSPD=4015.334792cps, LSPD=3855.058824cps
threadcount=2
clocks: 1867776, TSPD=1562.992469cps, LSPD=1365.333333cps
DEPEND_OPT=1
clocks: 1769472, TSPD=6652.150376cps, LSPD=5461.333333cps
softmax_168 complete
0.4901 n03085013 computer keyboard, keypad
0.1591 n04264628 space bar
0.0543 n04074963 remote control, remote
0.0439 n03832673 notebook, notebook computer
0.0356 n04505470 typewriter keyboard
clocks: 1884160, TSPD=1567.520799cps, LSPD=2340.571429cps
clocks: 1835008, TSPD=6746.352941cps, LSPD=10922.666667cps
func
clocks: 1802240, TSPD=1751.448008cps, LSPD=1638.400000cps
DEPEND_OPT=0
clocks: 1769472, TSPD=4086.540416cps, LSPD=4369.066667cps
softmax_168 complete
0.4901 n03085013 computer keyboard, keypad
0.1591 n04264628 space bar
0.0543 n04074963 remote control, remote
0.0439 n03832673 notebook, notebook computer
0.0356 n04505470 typewriter keyboard
clocks: 1818624, TSPD=1752.046243cps, LSPD=1820.444444cps
usebigint == 0
clocks: 1802240, TSPD=3746.860707cps, LSPD=4096.000000cps
softmax_168 complete
0.4901 n03085013 computer keyboard, keypad
0.1591 n04264628 space bar
0.0543 n04074963 remote control, remote
0.0439 n03832673 notebook, notebook computer
0.0356 n04505470 typewriter keyboard
clocks: 1818624, TSPD=3749.740206cps, LSPD=4096.000000cps
clocks: 1802240, TSPD=4114.703196cps, LSPD=4096.000000cps
softmax_168 complete
0.4901 n03085013 computer keyboard, keypad
0.1591 n04264628 space bar
0.0543 n04074963 remote control, remote
0.0439 n03832673 notebook, notebook computer
0.0356 n04505470 typewriter keyboard
clocks: 1818624, TSPD=4114.533937cps, LSPD=4096.000000cps
clocks: 1802240, TSPD=3859.186296cps, LSPD=4096.000000cps
softmax_168 complete
0.4901 n03085013 computer keyboard, keypad
0.1591 n04264628 space bar
0.0543 n04074963 remote control, remote
0.0439 n03832673 notebook, notebook computer
0.0356 n04505470 typewriter keyboard
clocks: 1818624, TSPD=3861.197452cps, LSPD=4096.000000cps
clocks: 1835008, TSPD=4086.877506cps, LSPD=4096.000000cps
threadcount=1
clocks: 1867776, TSPD=993.497872cps, LSPD=963.764706cps
softmax_168 complete
0.4901 n03085013 computer keyboard, keypad
0.1591 n04264628 space bar
0.0543 n04074963 remote control, remote
0.0439 n03832673 notebook, notebook computer
0.0356 n04505470 typewriter keyboard
clocks: 1884160, TSPD=993.755274cps, LSPD=1024.000000cps
usebitint == 0
clocks: 1802240, TSPD=2549.137199cps, LSPD=2730.666667cps
DEPEND_OPT=1
clocks: 1769472, TSPD=4915.200000cps, LSPD=5957.818182cps
softmax_168 complete
0.4901 n03085013 computer keyboard, keypad
0.1591 n04264628 space bar
0.0543 n04074963 remote control, remote
0.0439 n03832673 notebook, notebook computer
0.0356 n04505470 typewriter keyboard
clocks: 1818624, TSPD=2547.092437cps, LSPD=2340.571429cps
clocks: 1835008, TSPD=4932.817204cps, LSPD=5461.333333cps
clocks: 1802240, TSPD=2802.861586cps, LSPD=2730.666667cps
DEPEND_OPT=0
clocks: 1769472, TSPD=2886.577488cps, LSPD=2978.909091cps
softmax_168 complete
0.4901 n03085013 computer keyboard, keypad
0.1591 n04264628 space bar
0.0543 n04074963 remote control, remote
0.0439 n03832673 notebook, notebook computer
0.0356 n04505470 typewriter keyboard
clocks: 1818624, TSPD=2802.194145cps, LSPD=2730.666667cps
clocks: 1835008, TSPD=2894.334385cps, LSPD=3120.761905cps
i9 10900 32G
threadcount=32
......
......@@ -141,7 +141,7 @@ static int free_signal_item(IDListVarPtr item, void* param)
if (pitem->signalname != NULL) {
mt_free(pitem->signalname);
}
objectRelease(pitem->lastvalue);
variableDestroy(pitem->lastvalue);
mt_free(pitem);
objectCall1(itemobj, SetData, NULL);
objectRelease(itemobj);
......@@ -161,7 +161,7 @@ static void hdl4sevcdfileDestroy(HOBJECT object)
}
mt_free(pobj->tempbuf);
dlistTraversal(&pobj->signallist, free_signal_item, pobj);
objectRelease(pobj->tempvar);
variableDestroy(pobj->tempvar);
memset(pobj, 0, sizeof(sHDL4SEVcdFile));
mt_free(pobj);
}
......
......@@ -19,8 +19,8 @@ extern char* yytext;
static char logbuf[64 * 1024];
#define GOOGLENET 0
#define TERRIS 0
#define COUNTER 1
#define TERRIS 1
#define COUNTER 0
#ifdef WIN32
#define WORKDIR "d:/gitwork"
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册