start pattern without binaries

This commit is contained in:
2020-05-15 17:06:08 +02:00
parent 00c1211c56
commit ecc692ad9a
11 changed files with 57 additions and 24 deletions

View File

@ -90,6 +90,7 @@
/* Config RW regiseter */
#define CONFIG_REG (0x20 * REG_OFFSET + BASE_CONTROL)
#define CONFIG_COUNTER_ENA_OFST (0)
#define CONFIG_COUNTER_ENA_MSK (0x00000003 << CONFIG_COUNTER_ENA_OFST)
#define CONFIG_COUNTER_ENA_DEFAULT_VAL ((0x0 << CONFIG_COUNTER_ENA_OFST) & CONFIG_COUNTER_ENA_MSK)
@ -110,6 +111,8 @@
#define CONTROL_STRT_ACQSTN_MSK (0x00000001 << CONTROL_STRT_ACQSTN_OFST)
#define CONTROL_STP_ACQSTN_OFST (1)
#define CONTROL_STP_ACQSTN_MSK (0x00000001 << CONTROL_STP_ACQSTN_OFST)
#define CONTROL_STRT_PATTERN_OFST (2)
#define CONTROL_STRT_PATTERN_MSK (0x00000001 << CONTROL_STRT_PATTERN_OFST)
#define CONTROL_CRE_RST_OFST (10)
#define CONTROL_CRE_RST_MSK (0x00000001 << CONTROL_CRE_RST_OFST)
#define CONTROL_PRPHRL_RST_OFST (11) // Only GBE10?

View File

@ -716,10 +716,8 @@ int setTrimbits(int *trimbits) {
int start = 0, nloop = 0;
setPatternLoop(-1, &start, &iaddr, &nloop);
}
// load the trimbits
#ifndef VIRTUAL
startStateMachine();
#endif
// send pattern to the chips
startPattern();
}
// copy trimbits locally
@ -1186,6 +1184,11 @@ int *getDetectorPosition() { return detPos; }
/* pattern */
void startPattern() {
LOG(logINFOBLUE, ("Starting Pattern\n"));
bus_w(CONTROL_REG, bus_r(CONTROL_REG) | CONTROL_STRT_PATTERN_MSK);
}
uint64_t readPatternWord(int addr) {
// error (handled in tcp)
if (addr < 0 || addr >= MAX_PATTERN_LENGTH) {