#include <iostream>
#include <fstream>
-#include "add.cpp"
+#include CXX_FILE
#define VCD
indicates that receiver wants to know the status of TDO.
"Q" means "quit socket".
*/
-int read_openocd_jtagremote(cxxrtl_design::p_add &top, int sock)
+int read_openocd_jtagremote(DESIGN &top, int sock)
{
char c;
if (read_handler(sock, &c) != 1) {
printf ("read %c\n", c);
if ((c >= '0') && (c <= '7'))
{
- top.p_tck.set<bool>(((c - '0') >> 2) & 1);
- top.p_tms.set<bool>(((c - '0') >> 1) & 1);
- top.p_tdi.set<bool>((c - '0') & 1);
+ top.p_jtag__tck.set<bool>(((c - '0') >> 2) & 1);
+ top.p_jtag__tms.set<bool>(((c - '0') >> 1) & 1);
+ top.p_jtag__tdi.set<bool>((c - '0') & 1);
}
if (c == 'R')
{
- uint8_t val = top.p_tdo.get<uint8_t>() + '0';
+ uint8_t val = top.p_jtag__tdo.get<uint8_t>() + '0';
if(-1 == write(sock, &val, 1))
{
printf("Error writing on socket\n");
int main()
{
- cxxrtl_design::p_add top;
+ DESIGN top;
int steps = 0;
#ifdef VCD
#endif
while (true) {
- top.p_clk.set<bool>(false);
+ top.p_sys__clk.set<bool>(false);
top.step();
#ifdef VCD
vcd.sample(steps*2 + 0);
#endif
- top.p_clk.set<bool>(true);
+ top.p_sys__clk.set<bool>(true);
top.step();
#ifdef VCD
vcd.sample(steps*2 + 1);
/* read and process incoming jtag. sock set to -1 if disconnected */
sock = read_openocd_jtagremote(top, sock);
- // quick check that the output is correct (it's an adder: go figure)
- /*
- top.p_a.set<uint8_t>(5);
- top.p_b.set<uint8_t>(3);
- uint32_t f = top.p_f.get<uint32_t>();
-
- cout << "f " << f << endl;
- */
-
waves << vcd.buffer;
vcd.buffer.clear();
}