Skip to content

Commit

Permalink
apply bug fix and correction in #204 and ff_laser_fault #202
Browse files Browse the repository at this point in the history
  • Loading branch information
pkotamnives committed Jan 15, 2024
1 parent fdcbe2b commit 3598473
Show file tree
Hide file tree
Showing 5 changed files with 44 additions and 65 deletions.
66 changes: 33 additions & 33 deletions projects/cm_mcu/LocalTasks.c
Original file line number Diff line number Diff line change
Expand Up @@ -173,10 +173,10 @@ struct sm_command_t sm_command_ffldaq_f1[] = {
{1, 0x00, 0x16, 2, "FF_TEMPERATURE", 0xff, "C", PM_STATUS},
{1, 0x00, 0x03, 1, "FF_LOS_ALARM", 0xff, "", PM_STATUS},
{1, 0x00, 0x05, 1, "FF_CDR_LOL_ALARM", 0xff, "", PM_STATUS},
{2, 0x00, 0x22, 1, "FF_CH01_OPT_POW", 0xff, "mw", PM_STATUS}, // read 4 Rx-ch registers with increasing addresses
{2, 0x00, 0x24, 1, "FF_CH02_OPT_POW", 0xff, "mw", PM_STATUS},
{2, 0x00, 0x26, 1, "FF_CH03_OPT_POW", 0xff, "mw", PM_STATUS},
{2, 0x00, 0x28, 1, "FF_CH04_OPT_POW", 0xff, "mw", PM_STATUS},
{2, 0x00, 0x22, 2, "FF_CH01_OPT_POW", 0xff, "mw", PM_STATUS}, // read 4 Rx-ch registers with increasing addresses
{2, 0x00, 0x24, 2, "FF_CH02_OPT_POW", 0xff, "mw", PM_STATUS},
{2, 0x00, 0x26, 2, "FF_CH03_OPT_POW", 0xff, "mw", PM_STATUS},
{2, 0x00, 0x28, 2, "FF_CH04_OPT_POW", 0xff, "mw", PM_STATUS},
};

uint16_t ffldaq_f1_values[NSUPPLIES_FFLDAQ_F1 * NCOMMANDS_FFLDAQ_F1];
Expand Down Expand Up @@ -230,18 +230,18 @@ struct sm_command_t sm_command_fflot_f1[] = {
{1, 0x00, 0x16, 2, "FF_TEMPERATURE", 0xff, "C", PM_STATUS},
{2, 0x00, 0x07, 1, "FF_LOS_ALARM", 0xffff, "", PM_STATUS},
{2, 0x00, 0x14, 1, "FF_CDR_LOL_ALARM", 0xffff, "", PM_STATUS},
{2, 0x01, 0xe4, 1, "FF_CH01_OPT_POW", 0xff, "mw", PM_STATUS}, // read 12 Rx-ch registers with decreasing addresses
{2, 0x01, 0xe2, 1, "FF_CH02_OPT_POW", 0xff, "mw", PM_STATUS},
{2, 0x01, 0xe0, 1, "FF_CH03_OPT_POW", 0xff, "mw", PM_STATUS},
{2, 0x01, 0xde, 1, "FF_CH04_OPT_POW", 0xff, "mw", PM_STATUS},
{2, 0x01, 0xdc, 1, "FF_CH05_OPT_POW", 0xff, "mw", PM_STATUS},
{2, 0x01, 0xda, 1, "FF_CH06_OPT_POW", 0xff, "mw", PM_STATUS},
{2, 0x01, 0xd8, 1, "FF_CH07_OPT_POW", 0xff, "mw", PM_STATUS},
{2, 0x01, 0xd6, 1, "FF_CH08_OPT_POW", 0xff, "mw", PM_STATUS},
{2, 0x01, 0xd4, 1, "FF_CH09_OPT_POW", 0xff, "mw", PM_STATUS},
{2, 0x01, 0xd2, 1, "FF_CH10_OPT_POW", 0xff, "mw", PM_STATUS},
{2, 0x01, 0xd0, 1, "FF_CH11_OPT_POW", 0xff, "mw", PM_STATUS},
{2, 0x01, 0xce, 1, "FF_CH12_OPT_POW", 0xff, "mw", PM_STATUS},
{2, 0x01, 0xe4, 2, "FF_CH01_OPT_POW", 0xff, "mw", PM_STATUS}, // read 12 Rx-ch registers with decreasing addresses
{2, 0x01, 0xe2, 2, "FF_CH02_OPT_POW", 0xff, "mw", PM_STATUS},
{2, 0x01, 0xe0, 2, "FF_CH03_OPT_POW", 0xff, "mw", PM_STATUS},
{2, 0x01, 0xde, 2, "FF_CH04_OPT_POW", 0xff, "mw", PM_STATUS},
{2, 0x01, 0xdc, 2, "FF_CH05_OPT_POW", 0xff, "mw", PM_STATUS},
{2, 0x01, 0xda, 2, "FF_CH06_OPT_POW", 0xff, "mw", PM_STATUS},
{2, 0x01, 0xd8, 2, "FF_CH07_OPT_POW", 0xff, "mw", PM_STATUS},
{2, 0x01, 0xd6, 2, "FF_CH08_OPT_POW", 0xff, "mw", PM_STATUS},
{2, 0x01, 0xd4, 2, "FF_CH09_OPT_POW", 0xff, "mw", PM_STATUS},
{2, 0x01, 0xd2, 2, "FF_CH10_OPT_POW", 0xff, "mw", PM_STATUS},
{2, 0x01, 0xd0, 2, "FF_CH11_OPT_POW", 0xff, "mw", PM_STATUS},
{2, 0x01, 0xce, 2, "FF_CH12_OPT_POW", 0xff, "mw", PM_STATUS},

};

Expand Down Expand Up @@ -319,10 +319,10 @@ struct sm_command_t sm_command_ffldaq_f2[] = {
{1, 0x00, 0x16, 2, "FF_TEMPERATURE", 0xff, "C", PM_STATUS},
{1, 0x00, 0x03, 1, "FF_LOS_ALARM", 0xff, "", PM_STATUS},
{1, 0x00, 0x05, 1, "FF_CDR_LOL_ALARM", 0xff, "", PM_STATUS},
{2, 0x00, 0x22, 1, "FF_CH01_OPT_POW", 0xff, "mw", PM_STATUS}, // read 4 Rx-ch registers with increasing addresses
{2, 0x00, 0x24, 1, "FF_CH02_OPT_POW", 0xff, "mw", PM_STATUS},
{2, 0x00, 0x26, 1, "FF_CH03_OPT_POW", 0xff, "mw", PM_STATUS},
{2, 0x00, 0x28, 1, "FF_CH04_OPT_POW", 0xff, "mw", PM_STATUS},
{2, 0x00, 0x22, 2, "FF_CH01_OPT_POW", 0xff, "mw", PM_STATUS}, // read 4 Rx-ch registers with increasing addresses
{2, 0x00, 0x24, 2, "FF_CH02_OPT_POW", 0xff, "mw", PM_STATUS},
{2, 0x00, 0x26, 2, "FF_CH03_OPT_POW", 0xff, "mw", PM_STATUS},
{2, 0x00, 0x28, 2, "FF_CH04_OPT_POW", 0xff, "mw", PM_STATUS},
};
uint16_t ffldaq_f2_values[NSUPPLIES_FFLDAQ_F2 * NCOMMANDS_FFLDAQ_F2];

Expand Down Expand Up @@ -374,18 +374,18 @@ struct sm_command_t sm_command_fflot_f2[] = {
{1, 0x00, 0x16, 2, "FF_TEMPERATURE", 0xff, "C", PM_STATUS},
{2, 0x00, 0x07, 1, "FF_LOS_ALARM", 0xffff, "", PM_STATUS},
{2, 0x00, 0x14, 1, "FF_CDR_LOL_ALARM", 0xffff, "", PM_STATUS},
{2, 0x01, 0xe4, 1, "FF_CH01_OPT_POW", 0xff, "mw", PM_STATUS}, // read 12 Rx-ch registers with decreasing addresses
{2, 0x01, 0xe2, 1, "FF_CH02_OPT_POW", 0xff, "mw", PM_STATUS},
{2, 0x01, 0xe0, 1, "FF_CH03_OPT_POW", 0xff, "mw", PM_STATUS},
{2, 0x01, 0xde, 1, "FF_CH04_OPT_POW", 0xff, "mw", PM_STATUS},
{2, 0x01, 0xdc, 1, "FF_CH05_OPT_POW", 0xff, "mw", PM_STATUS},
{2, 0x01, 0xda, 1, "FF_CH06_OPT_POW", 0xff, "mw", PM_STATUS},
{2, 0x01, 0xd8, 1, "FF_CH07_OPT_POW", 0xff, "mw", PM_STATUS},
{2, 0x01, 0xd6, 1, "FF_CH08_OPT_POW", 0xff, "mw", PM_STATUS},
{2, 0x01, 0xd4, 1, "FF_CH09_OPT_POW", 0xff, "mw", PM_STATUS},
{2, 0x01, 0xd2, 1, "FF_CH10_OPT_POW", 0xff, "mw", PM_STATUS},
{2, 0x01, 0xd0, 1, "FF_CH11_OPT_POW", 0xff, "mw", PM_STATUS},
{2, 0x01, 0xce, 1, "FF_CH12_OPT_POW", 0xff, "mw", PM_STATUS},
{2, 0x01, 0xe4, 2, "FF_CH01_OPT_POW", 0xff, "mw", PM_STATUS}, // read 12 Rx-ch registers with decreasing addresses
{2, 0x01, 0xe2, 2, "FF_CH02_OPT_POW", 0xff, "mw", PM_STATUS},
{2, 0x01, 0xe0, 2, "FF_CH03_OPT_POW", 0xff, "mw", PM_STATUS},
{2, 0x01, 0xde, 2, "FF_CH04_OPT_POW", 0xff, "mw", PM_STATUS},
{2, 0x01, 0xdc, 2, "FF_CH05_OPT_POW", 0xff, "mw", PM_STATUS},
{2, 0x01, 0xda, 2, "FF_CH06_OPT_POW", 0xff, "mw", PM_STATUS},
{2, 0x01, 0xd8, 2, "FF_CH07_OPT_POW", 0xff, "mw", PM_STATUS},
{2, 0x01, 0xd6, 2, "FF_CH08_OPT_POW", 0xff, "mw", PM_STATUS},
{2, 0x01, 0xd4, 2, "FF_CH09_OPT_POW", 0xff, "mw", PM_STATUS},
{2, 0x01, 0xd2, 2, "FF_CH10_OPT_POW", 0xff, "mw", PM_STATUS},
{2, 0x01, 0xd0, 2, "FF_CH11_OPT_POW", 0xff, "mw", PM_STATUS},
{2, 0x01, 0xce, 2, "FF_CH12_OPT_POW", 0xff, "mw", PM_STATUS},
};

#ifdef REV1
Expand Down Expand Up @@ -818,7 +818,7 @@ void getFFpart()
strncpy(vendor_string, vendor_string_rxch, nstring);
}
else {
if (strncmp(vendor_string_rxch, vendor_string, nstring) == 0 && (strstr(vendor_string_rxch, "14") == NULL) && (strstr(vendor_string_rxch, "CRRNB") == NULL)) {
if (strstr(vendor_string_rxch, "14") == NULL && strstr(vendor_string_rxch, "CRRNB") == NULL) {
tmp_ffpart_bit_mask = tmp_ffpart_bit_mask | (0x1U << n); // bit 1 for a 25Gbs ch and assign to a Bit-mask of Firefly 12-ch part
}
else {
Expand Down
2 changes: 1 addition & 1 deletion projects/cm_mcu/ZynqMonTask.c
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ static void format_data(const uint16_t sensor, const uint16_t data, uint8_t mess
message[1] = SENSOR_MESSAGE_DATA_FRAME;
message[1] |= ((sensor & 0xf) << 2) | ((RESERVED_DATA >> 2) & 0x3);

// rest of reserved[1:0] (2 bits) and start of data[15:14] (2 bits)
// rest of reserved[1:0] (2 bits) and start of data[15:12] (4 bits)
message[2] = SENSOR_MESSAGE_DATA_FRAME;
message[2] |= ((RESERVED_DATA & 0x3) << 4) | ((data >> 12) & 0xF);

Expand Down
37 changes: 10 additions & 27 deletions sm_cm_config/data/PL_MEM_CM_rev2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -205,8 +205,17 @@ config:
mcu_extra_call: 3
names:
- MCU_CLKR1B_VER
- name: firefly_bits
- name: clkr1cconfigversion
start: 244
count: 4
type: char
size: 2
mcu_call: clkconfigversion
mcu_extra_call: 4
names:
- MCU_CLKR1C_VER
- name: firefly_bits
start: 248
count: 8
type: uint16_t
extra: Table=CM_FFARGV_MON;Status=1
Expand All @@ -220,29 +229,3 @@ config:
postfixes:
- IS_FF25Gbs
- IS_PRESENT
- name: hexdata
start: 252
count: 16
type: uint16_t
extra: Table=CM_HEX_MON;Status=1
mcu_call: hexdata
mcu_extra_call: null
names:
- HEXFC
- HEXFD
- HEXFE
- HEXFF
- HEX100
- HEX101
- HEX102
- HEX103
- HEX104
- HEX105
- HEX106
- HEX107
- HEX108
- HEX109
- HEX10a
- HEX10b
postfixes:
- Column0
1 change: 0 additions & 1 deletion sm_cm_config/src/mcu_generate.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@
expected_length *= len(c['postfixes'])
if '32' in c['type']:
expected_length *= 2
#expected_length += 1 #FIXME
elif 'char' in c['type']:
expected_length = expected_length/2.
if 'size' in c:
Expand Down
3 changes: 0 additions & 3 deletions sm_cm_config/src/xml_generate.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,15 +103,12 @@ def __str__(self):

def overlaps(self, other):
"""calculate overlap between two objects"""
actual_size = self.size * (self.width/16) # the self.size is counted based on a 16-bit data
if (self.start <= other.start and self.end >= other.start):
return True
if (self.start <= other.end and self.end >= other.end):
return True
if (self.start >= other.start and self.end <= other.end):
return True
if (abs(self.start - other.start) < actual_size): # the next other.start is larger than self.start + self.size when e.g. data is 32-bit
return True
return False

def overloads(self):
Expand Down

0 comments on commit 3598473

Please sign in to comment.