Moved location of patternGenerator directory.

Updated generator.c to include 3 additional timers and loops
This commit is contained in:
2022-11-16 17:47:54 +01:00
parent 06fc48b115
commit b432c70076
4 changed files with 18 additions and 24 deletions

View File

@@ -24,9 +24,9 @@ gcc -DINFILE="\"test.p\"" -DOUTFILE="\"test.pat\"" -o test.exe generator.c ; ./t
#include <string.h> #include <string.h>
#include <unistd.h> #include <unistd.h>
#define MAXLOOPS 3 #define MAXLOOPS 6
#define MAXTIMERS 3 #define MAXTIMERS 6
#define MAXWORDS 1024 #define MAXWORDS 8191
@@ -35,12 +35,12 @@ uint64_t iopat=0;
uint64_t clkpat=0; uint64_t clkpat=0;
int iaddr=0; int iaddr=0;
int waitaddr[3]={MAXWORDS,MAXWORDS,MAXWORDS}; int waitaddr[MAXTIMERS]={MAXWORDS,MAXWORDS,MAXWORDS, MAXWORDS, MAXWORDS, MAXWORDS};
int startloopaddr[3]={MAXWORDS,MAXWORDS,MAXWORDS}; int startloopaddr[MAXLOOPS]={MAXWORDS,MAXWORDS,MAXWORDS, MAXWORDS, MAXWORDS, MAXWORDS};
int stoploopaddr[3]={MAXWORDS,MAXWORDS,MAXWORDS}; int stoploopaddr[MAXLOOPS]={MAXWORDS,MAXWORDS,MAXWORDS, MAXWORDS, MAXWORDS, MAXWORDS};
int start=0, stop=0; int start=0, stop=0;
uint64_t waittime[3]={0,0,0}; uint64_t waittime[MAXTIMERS]={0,0,0};
int nloop[3]={0,0,0}; int nloop[MAXLOOPS]={0,0,0};
char infile[10000], outfile[10000]; char infile[10000], outfile[10000];
@@ -69,14 +69,7 @@ void setoutput(int bit) {
mask=mask<<bit; mask=mask<<bit;
iopat |= mask; iopat |= mask;
} }
/*
void setclk(int bit) {
uint64_t mask=1;
mask=mask<<bit;
iopat |= mask;
clkpat |= mask;
}
*/
void clearbit(int bit){ void clearbit(int bit){
uint64_t mask=1; uint64_t mask=1;
mask=mask<<bit; mask=mask<<bit;
@@ -151,13 +144,12 @@ int parseCommand(int clk, int cmdbit, int cmd, int length) {
main(void) { int main() {
int iloop=0; int iloop=0;
fd=fopen(OUTFILE,"w"); fd=fopen(OUTFILE,"w");
#include INFILE #include INFILE
fprintf(fd,"patioctrl 0x%016llx\n",iopat); fprintf(fd,"patioctrl 0x%016llx\n",iopat);
//fprintf(fd,"patclkctrl 0x%016llx\n",clkpat);
fprintf(fd,"patlimits 0x%04x 0x%04x\n",start, stop); fprintf(fd,"patlimits 0x%04x 0x%04x\n",start, stop);
for (iloop=0; iloop<MAXLOOPS; iloop++) { for (iloop=0; iloop<MAXLOOPS; iloop++) {
@@ -172,8 +164,10 @@ main(void) {
fprintf(fd,"patwaittime %d %lld\n",iloop, waittime[iloop]); fprintf(fd,"patwaittime %d %lld\n",iloop, waittime[iloop]);
} }
close((int)fd); fclose(fd);
fd1=fopen(OUTFILEBIN,"w"); fd1=fopen(OUTFILEBIN,"w");
fwrite(PAT,sizeof(uint64_t),iaddr, fd1); fwrite(PAT,sizeof(uint64_t),iaddr, fd1);
close((int)fd1); fclose(fd1);
return 0;
} }