Mofifications to jungfrau server and pattern generator

This commit is contained in:
2014-12-03 10:23:05 +01:00
parent 5fe8c6e457
commit 8eea6f1d83
9 changed files with 83 additions and 44 deletions

View File

@ -9,13 +9,22 @@ if [ "$#" -ge 2 ]; then
outfile=$2
fi
exe=$infile"exe"
if [ "$#" -ge 4 ]; then
exe=$4
fi
if [ "$#" -ge 3 ]; then
exe=$3
outfilebin=$3
fi
if [ -f "$infile" ]
then
gcc -DINFILE="\"$infile\"" -DOUTFILE="\"$outfile\"" -DOUTFILEBIN="\"$outfilebin\"" -o $exe generator.c ; ./$exe ; rm $exe
gcc -DINFILE="\"$infile\"" -DOUTFILE="\"$outfile\"" -DOUTFILEBIN="\"$outfilebin\"" -o $exe generator.c ;
echo compiling
$exe ;
echo cleaning
rm $exe
echo done
else
echo "$infile not found."
fi

View File

@ -6,12 +6,12 @@ gcc -DINFILE="\"test.p\"" -DOUTFILE="\"test.pat\"" -o test.exe generator.c ; ./t
*************************************************************************/
#include <stdlib.h> /* exit() */
#include <stdint.h> /* exit() */
#include <string.h> /* memset(), memcpy() */
#include <sys/utsname.h> /* uname() */
#include <stdlib.h>
#include <stdint.h>
#include <string.h>
#include <sys/utsname.h>
#include <sys/types.h>
#include <unistd.h> /* fork(), write(), close() */
#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <errno.h>
@ -21,7 +21,6 @@ gcc -DINFILE="\"test.p\"" -DOUTFILE="\"test.pat\"" -o test.exe generator.c ; ./t
#include <stdio.h>
#include <string.h>
#include <unistd.h>
//#include <asm/page.h>
#define MAXLOOPS 3
#define MAXTIMERS 3
@ -48,8 +47,6 @@ uint64_t PAT[MAXWORDS];
int i,ii,iii,j,jj,jjj,pixx,pixy,memx,memy,muxout,memclk,colclk,rowclk,muxclk,memcol,memrow,loopcounter;
//int W[33];
//u_int32_t W;
void setstart() {
start=iaddr;
@ -81,16 +78,12 @@ void setclk(int bit) {
void clearbit(int bit){
uint64_t mask=1;
mask=mask<<bit;
// printf("CB %d %016llx %016llx ",bit, pat, mask);
pat &= ~mask;
// printf("%016llx\n", pat);
}
void setbit(int bit){
uint64_t mask=1;
mask=mask<<bit;
// printf("SB %d %016llx %016llx ",bit, pat, mask);
pat |= mask;
// printf("%016llx\n", pat);
}
int checkbit(int bit) {

12
slsDetectorSoftware/patternGenerator/test.p Normal file → Executable file
View File

@ -151,11 +151,15 @@ CB(bottom_din);PW;
}
//END of FUNCTIONS
////////////////////////////////////////////////////////
//LET'S BYPASS PREAMP AND CDS and write on preamp out.//
//LET BYPASS PREAMP AND CDS and write on preamp out.//
//THIS ALLOWS CHECKING SOURCE FOLLOWERS //
////////////////////////////////////////////////////////
PW;
SB(5); PW;
CB(5); PW;
START; //pattern starts from here
@ -164,13 +168,13 @@ setwaitpoint(0); //set wait points
PW;
setwaittime(0,20); //wait time - can be changed dynamically
SB(adc_ena);PW;
SB(adc_sync);
printf("ADC sync %x %d %llx\n",iaddr,adc_sync, pat);
SB(adc_sync);PW;
printf("ADC sync %x %d %llx\n",iaddr, adc_sync, pat);
CB(gHG);
setwaitpoint(1); //set wait points
setwaittime(1,16); //wait time - can be changed dynamically
CB(adc_sync);PW;
//NB: We have to SELECT A PIXEL to enable column out.
//SELECT PIXEL 1,1 for readout
load_pix(10, 20);
CB(res);