-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdanke_testbench.cpp
More file actions
30 lines (23 loc) · 1003 Bytes
/
danke_testbench.cpp
File metadata and controls
30 lines (23 loc) · 1003 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#include "danke.h"
#include <ap_int.h>
#include <iostream>
using namespace std;
#define DUMP_START_ADDR 10
#define DUMP_NUM_ADDRS 4
int main()
{
unsigned instruction_memory[INSTR_MEM_SIZE] = { 0x400410, 0x8020, 0xa00005, 0x20412, 0x420421, 0x20038, 0x8303fd, 0xc00020, 0x28020, 0x1020010, 0x1800000, 0x800000 };
data_t data_memory[DATA_MEM_SIZE] = {DUMP_START_ADDR};
halted_t halted[4] = {0,0,0,0};
unsigned coreids[4] = {0,1,2,3};
cout << "Starting DANKE core!" << endl;
danke_core(instruction_memory, data_memory, &(halted[0]), &(coreids[0]));
danke_core(instruction_memory, data_memory, &(halted[1]), &(coreids[1]));
danke_core(instruction_memory, data_memory, &(halted[2]), &(coreids[2]));
danke_core(instruction_memory, data_memory, &(halted[3]), &(coreids[3]));
cout << "DANKE core has completed!" << endl;
cout << "Memory dump:" << endl;
for(int i = DUMP_START_ADDR; i < DUMP_START_ADDR + DUMP_NUM_ADDRS; i++)
cout << hex << i << ": " << data_memory[i] << endl;
return 0;
}