HFCC-01 Low-Level Software (LLSW) Rel_6802_HFCC-01-RP-CSAR-CB
Loading...
Searching...
No Matches
modInfo.c File Reference
#include "modInfo.h"
#include "core.h"
#include "memoryOper.h"
#include "modStatus.h"
Include dependency graph for modInfo.c:
modInfo.c Node1 modInfo.c Node2 modInfo.h Node1->Node2 Node3 modStatus.h Node1->Node3 Node5 core.h Node1->Node5 Node9 memoryOper.h Node1->Node9 Node2->Node3 Node4 commonDataTypes.h Node2->Node4 Node5->Node4 Node6 driverStatus.h Node5->Node6 Node7 interDrv.h Node5->Node7 Node7->Node4 Node8 interStatus.h Node7->Node8

Functions

ModStatus errCheck (const DriverStatus status)
 errCheck.
static void fillUpAscii (char *array, const UInt32 charCount, const char *charVal)
 fillUpAscii.
static void extractInfo (CardDetails cardDetails, BoardInfo *brdInfoPtr)
 extractInfo.
ModStatus modInfo_getDLMInfo (DLMInfo *dlmInfo)
 modInfo_getDLMInfo.
ModStatus modInfo_getBrdInfo (CardType cardType, BoardInfo *brdInfoPtr)
 modInfo_getBrdInfo.

Variables

CardInfo globalCard [MOD_INFO_MAX_CARD]

Detailed Description

Function Documentation

◆ errCheck()

ModStatus errCheck ( const DriverStatus status)
extern

errCheck.

Check the driver status and convert it to the module status.

Parameters
[in]statusStatus from driver.
Returns
ModStatus - Module status return code. If no error occurs during the operation of the function, it returns MD_SUCCESS. Otherwise, a related error message is returned.
Return values
MD_SUCCESS: The module operation is successful.
MD_INVALID_ADDRESS: The module base memory address is not valid.
MD_INVALID_CHANNEL: The passing argument for channel number is not valid.
MD_READ_ERR: The module is unable to read from a certain register.
MD_WRITE_ERR: The module is unable to write to a certain register.
MD_FIFO_EMPTY: The module FIFO is empty.
MD_FIFO_FULL: The module FIFO is full.
MD_INVALID_PARAM: The provided address pointer is invalid.
MD_INVALID_VALUE: The passing argument is invalid or not within range.
MD_INVALID_CONFIG: The module is not yet configured.
MD_INVALID_INIT: The module is not initialized.
MD_OP_ALREADY_PERFORMED: The module operation has already been performed.
MD_OPEN_FAILED: The module is unable to open.
MD_FAILED: The module operation has failed.

Low-Level Software Requirements (LLR)

Low-Level Requirement Specification: errCheck

Requirement ID Parent HLR ID Detailed Low-Level Requirement Statement (EARS Format) Software Unit Reference Verification Method Status
LLR_STATUS_ERRCHECK_01 HLR_HM_79450 WHEN the driver status parameter is equal to DRV_SUCCESS, the errCheck() function SHALL return MD_SUCCESS. modStatus.c:errCheck() Test Closed
LLR_STATUS_ERRCHECK_02 HLR_HM_79450 WHEN the driver status parameter is equal to DRV_INVALID_ADDRESS, the errCheck() function SHALL return MD_INVALID_ADDRESS. modStatus.c:errCheck() Test Closed
LLR_STATUS_ERRCHECK_03 HLR_HM_79450 WHEN the driver status parameter is equal to DRV_INVALID_CHANNEL, the errCheck() function SHALL return MD_INVALID_CHANNEL. modStatus.c:errCheck() Test Closed
LLR_STATUS_ERRCHECK_04 HLR_HM_79450 WHEN the driver status parameter is equal to DRV_INVALID_DEVICE, the errCheck() function SHALL return MD_INVALID_DEVICE. modStatus.c:errCheck() Test Closed
LLR_STATUS_ERRCHECK_05 HLR_HM_79450 WHEN the driver status parameter is equal to DRV_READ_FAILED, the errCheck() function SHALL return MD_READ_ERR. modStatus.c:errCheck() Test Closed
LLR_STATUS_ERRCHECK_06 HLR_HM_79450 WHEN the driver status parameter is equal to DRV_WRITE_FAILED, the errCheck() function SHALL return MD_WRITE_ERR. modStatus.c:errCheck() Test Closed
LLR_STATUS_ERRCHECK_07 HLR_HM_79450 WHEN the driver status parameter is equal to DRV_FIFO_EMPTY, the errCheck() function SHALL return MD_FIFO_EMPTY. modStatus.c:errCheck() Test Closed
LLR_STATUS_ERRCHECK_08 HLR_HM_79450 WHEN the driver status parameter is equal to DRV_FIFO_FULL, the errCheck() function SHALL return MD_FIFO_FULL. modStatus.c:errCheck() Test Closed
LLR_STATUS_ERRCHECK_09 HLR_HM_79450 WHEN the driver status parameter is equal to DRV_INVALID_PARAM, the errCheck() function SHALL return MD_INVALID_PARAM. modStatus.c:errCheck() Test Closed
LLR_STATUS_ERRCHECK_10 HLR_HM_79450 WHEN the driver status parameter is equal to DRV_INVALID_VALUE, the errCheck() function SHALL return MD_INVALID_VALUE. modStatus.c:errCheck() Test Closed
LLR_STATUS_ERRCHECK_11 HLR_HM_79450 WHEN the driver status parameter is equal to DRV_INVALID_CONFIG, the errCheck() function SHALL return MD_INVALID_CONFIG. modStatus.c:errCheck() Test Closed
LLR_STATUS_ERRCHECK_12 HLR_HM_79450 WHEN the driver status parameter is equal to DRV_NOT_INITIALIZED, the errCheck() function SHALL return MD_INVALID_INIT. modStatus.c:errCheck() Test Closed
LLR_STATUS_ERRCHECK_13 HLR_HM_79450 WHEN the driver status parameter is equal to DRV_OP_ALREADY_PERFORMED, the errCheck() function SHALL return MD_OP_ALREADY_PERFORMED. modStatus.c:errCheck() Test Closed
LLR_STATUS_ERRCHECK_14 HLR_HM_79450 WHEN the driver status parameter is equal to DRV_OPEN_FAILED, the errCheck() function SHALL return MD_OPEN_FAILED. modStatus.c:errCheck() Test Closed
LLR_STATUS_ERRCHECK_15 HLR_HM_79450 WHEN the driver status parameter does not match any recognized driver error condition, the errCheck() function SHALL return MD_FAILED. modStatus.c:errCheck() Test Closed

Control Coupling Diagram (CCD)

ControlCouplingStructureChart Caller errCheck() [Low-Level Device Drivers] Target interDrv_Write32() / MMIO [Hardware Abstraction Layer] Caller:s->Target:n l_t0->l_b0   status (Flag) r_b0->r_t0   statusCode (ModStatus)
Control Coupling Structure Chart

Data Coupling Diagram (DCD)

DataCouplingStructureChart Caller errCheck() [Low-Level Device Drivers] Target interDrv_Write32() / MMIO [Hardware Abstraction Layer] Caller:s->Target:n l_t0->l_b0   status (Payload) r_b0->r_t0   stateTelemetry (Internal State)
Data Coupling Structure Chart

Control Flow Diagram (CFD)

cfd_errCheck start Entry: errCheck() guard_1 LLR_01: Guard Check Is `status` is not equal to `DRV_SUCCESS`? start->guard_1 err_exit_1 LLR_01 Error Exit execute conditional operational branch guard_1->err_exit_1 YES (TRUE) act_2 LLR_02: Action Step execute operational data processing and state transformations guard_1->act_2 NO (FALSE) success_exit LLR_03: Final Exit return `MD_SUCCESS` act_2->success_exit
Control Flow Diagram

Data Flow Diagram (DFD)

dfd_errCheck in_store Input Data Sources & Parameters • status (const DriverStatus) proc_1 LLR_01: Data Validation Check • Evaluate Parameter / State: status in_store->proc_1 Validated Input Data proc_2 LLR_02: Data Mutation & Processing • Transformed Entity: errCheck proc_1->proc_2 Transformed Data (errCheck) proc_3 LLR_03: Status Output Packaging • Format Return Payload: ModStatus proc_2->proc_3 Final Output Data out_sink Output Data Sinks & Status Return • Status Payload (ModStatus) proc_3->out_sink Output Data & Status Code
Data Flow Diagram

◆ extractInfo()

void extractInfo ( CardDetails cardDetails,
BoardInfo * brdInfoPtr )
static

extractInfo.

To extract board information.

Parameters
[in]cardDetailsCard Details.
[out]brdInfoPtrBoard information.
Returns
void.

Low-Level Software Requirements (LLR)

Low-Level Requirement Specification: extractInfo

Requirement ID Parent HLR ID Detailed Low-Level Requirement Statement (EARS Format) Software Unit Reference Verification Method Status
LLR_INFO_EXTRACTINFO_01 HLR_IO_31356 WHEN the pointer brdInfoPtr is NULL (invalid), the extractInfo() function SHALL abort processing and return immediately. modInfo.c:extractInfo() Test Closed
LLR_INFO_EXTRACTINFO_02 HLR_IO_31356 WHEN the pointer brdInfoPtr is valid, the extractInfo() function SHALL copy serial number, format ASCII strings for platform, model, generation, and main board revision, and unpack FPGA firmware version fields into brdInfoPtr. modInfo.c:extractInfo() Test Closed

Control Coupling Diagram (CCD)

ControlCouplingStructureChart Caller extractInfo() [Low-Level Device Drivers] Target fillUpAscii() [Low-Level Driver Helper] Caller:s->Target:n l_t0->l_b0   cardDetails (Flag) r_b0->r_t0   statusCode (void)
Control Coupling Structure Chart

Data Coupling Diagram (DCD)

DataCouplingStructureChart Caller extractInfo() [Low-Level Device Drivers] Target fillUpAscii() [Low-Level Driver Helper] Caller:s->Target:n l_t0->l_b0   cardDetails (Payload) r_b0->r_t0   *brdInfoPtr (Output Data)
Data Coupling Structure Chart

Control Flow Diagram (CFD)

cfd_extractInfo start Entry: extractInfo() guard_1 LLR_01: Guard Check Is the pointer `brdInfoPtr` is valid (not NULL)? start->guard_1 err_exit_1 LLR_01 Error Exit execute conditional operational branch guard_1->err_exit_1 YES (TRUE) act_2 LLR_02: Action Step invoke routine `fillUpAscii()` to execute target subsystem hardware operation guard_1->act_2 NO (FALSE) success_exit LLR_03: Final Exit return `the computed result` act_2->success_exit
Control Flow Diagram

Data Flow Diagram (DFD)

dfd_extractInfo in_store Input Data Sources & Parameters • cardDetails (CardDetails) proc_1 LLR_01: Data Validation Check • Evaluate Parameter / State: brdInfoPtr in_store->proc_1 Validated Input Data proc_2 LLR_02: Data Payload Transformation • Process payload via fillUpAscii() proc_1->proc_2 Data Payload (fillUpAscii) proc_3 LLR_03: Status Output Packaging • Format Return Payload: void proc_2->proc_3 Final Output Data out_sink Output Data Sinks & Status Return • brdInfoPtr (BoardInfo) proc_3->out_sink Output Data & Status Code
Data Flow Diagram
Here is the call graph for this function:
extractInfo Node1 extractInfo Node1->Node1 Node2 fillUpAscii Node1->Node2 Node2->Node2
Here is the caller graph for this function:
extractInfo Node1 extractInfo Node1->Node1 Node2 modInfo_getBrdInfo Node1->Node2 Node2->Node2

◆ fillUpAscii()

void fillUpAscii ( char * array,
const UInt32 charCount,
const char * charVal )
static

fillUpAscii.

To fill up ASCII characters.

Parameters
[out]arrayPointer to the array to be filled.
[in]charCountTotal number of character.
[in]charValCharacter value.
Returns
void.

Low-Level Software Requirements (LLR)

Low-Level Requirement Specification: fillUpAscii

Requirement ID Parent HLR ID Detailed Low-Level Requirement Statement (EARS Format) Software Unit Reference Verification Method Status
LLR_INFO_FILLUPASCII_01 HLR_IO_31356 WHEN length len is 0 or source string strSrc is NULL (invalid), the fillUpAscii() function SHALL abort processing and return immediately. modInfo.c:fillUpAscii() Test Closed
LLR_INFO_FILLUPASCII_02 HLR_IO_31356 WHEN parameters are valid, the fillUpAscii() function SHALL copy up to len characters from strSrc to destination string strDst and ensure null termination. modInfo.c:fillUpAscii() Test Closed

Control Coupling Diagram (CCD)

ControlCouplingStructureChart Caller fillUpAscii() [Low-Level Device Drivers] Target interDrv_Write32() / MMIO [Hardware Abstraction Layer] Caller:s->Target:n l_t0->l_b0   charCount (Flag) l_t1->l_b1   charVal (Flag) r_b0->r_t0   statusCode (void)
Control Coupling Structure Chart

Data Coupling Diagram (DCD)

DataCouplingStructureChart Caller fillUpAscii() [Low-Level Device Drivers] Target interDrv_Write32() / MMIO [Hardware Abstraction Layer] Caller:s->Target:n l_t0->l_b0   charCount (Payload) l_t1->l_b1   charVal (Payload) r_b0->r_t0   *array (Output Data)
Data Coupling Structure Chart

Control Flow Diagram (CFD)

cfd_fillUpAscii start Entry: fillUpAscii() guard_1 LLR_01: Guard Check Is (the pointer `array` is valid (not NULL)) && (the pointer `charVal` is valid (not NULL))? start->guard_1 err_exit_1 LLR_01 Error Exit execute conditional operational branch guard_1->err_exit_1 YES (TRUE) act_2 LLR_02: Action Step execute operational data processing and state transformations guard_1->act_2 NO (FALSE) success_exit LLR_03: Final Exit return `the computed result` act_2->success_exit
Control Flow Diagram

Data Flow Diagram (DFD)

dfd_fillUpAscii in_store Input Data Sources & Parameters • charCount (const UInt32) • charVal (const char) proc_1 LLR_01: Data Validation Check • Evaluate Parameter / State: array in_store->proc_1 Validated Input Data proc_2 LLR_02: Data Mutation & Processing • Transformed Entity: fillUpAscii proc_1->proc_2 Transformed Data (fillUpAscii) proc_3 LLR_03: Status Output Packaging • Format Return Payload: void proc_2->proc_3 Final Output Data out_sink Output Data Sinks & Status Return • array (char) proc_3->out_sink Output Data & Status Code
Data Flow Diagram
Here is the call graph for this function:
fillUpAscii Node1 fillUpAscii Node1->Node1
Here is the caller graph for this function:
fillUpAscii Node1 fillUpAscii Node1->Node1 Node2 extractInfo Node1->Node2 Node3 modInfo_getBrdInfo Node1->Node3 Node2->Node2 Node2->Node3 Node3->Node3

◆ modInfo_getBrdInfo()

ModStatus modInfo_getBrdInfo ( CardType cardType,
BoardInfo * brdInfoPtr )

modInfo_getBrdInfo.

Get board information.

Parameters
[in]cardTypeCard type to access.
[out]brdInfoPtrBoard information.
Returns
ModStatus - Module status return code, If no error occurs during the operation of the function, it returns MD_SUCCESS. Otherwise related error message is returned.
Return values
MD_SUCCESS: Success.
MD_INVALID_PARAM: The provided address pointer is invalid.
MD_OPEN_FAILED: Channel number is not valid.

Low-Level Software Requirements (LLR)

Low-Level Requirement Specification: modInfo_getBrdInfo

Requirement ID Parent HLR ID Detailed Low-Level Requirement Statement (EARS Format) Software Unit Reference Verification Method Status
LLR_INFO_MODINFO_GETBRDINFO_01 HLR_IO_31356 WHEN the pointer brdInfoPtr is NULL (invalid), the modInfo_getBrdInfo() function SHALL abort processing and return MD_INVALID_PARAM. modInfo.c:modInfo_getBrdInfo() Test Closed
LLR_INFO_MODINFO_GETBRDINFO_02 HLR_IO_31356 WHEN cardType is not one of MFB1_CARD through PSU_CARD, the modInfo_getBrdInfo() function SHALL abort processing and return MD_INVALID_CARD. modInfo.c:modInfo_getBrdInfo() Test Closed
LLR_INFO_MODINFO_GETBRDINFO_03 HLR_IO_31356 WHEN the requested card is in OPEN operating state, the modInfo_getBrdInfo() function SHALL read card information registers and populate brdInfoPtr using extractInfo(). modInfo.c:modInfo_getBrdInfo() Test Closed
LLR_INFO_MODINFO_GETBRDINFO_04 HLR_IO_31356 WHEN all operational processing completes successfully, the modInfo_getBrdInfo() function SHALL return MD_SUCCESS. modInfo.c:modInfo_getBrdInfo() Test Closed

Control Coupling Diagram (CCD)

ControlCouplingStructureChart Caller modInfo_getBrdInfo() [Device Library Modules] Target memoryOper_set() [Subordinate Routine] Caller:s->Target:n l_t0->l_b0   cardType (Flag) r_b0->r_t0   statusCode (ModStatus)
Control Coupling Structure Chart

Data Coupling Diagram (DCD)

DataCouplingStructureChart Caller modInfo_getBrdInfo() [Device Library Modules] Target memoryOper_set() [Subordinate Routine] Caller:s->Target:n l_t0->l_b0   cardType (Payload) r_b0->r_t0   *brdInfoPtr (Output Data)
Data Coupling Structure Chart

Control Flow Diagram (CFD)

cfd_modInfo_getBrdInfo start Entry: modInfo_getBrdInfo() guard_1 LLR_01: Guard Check Is the pointer `brdInfoPtr` is valid (not NULL)? start->guard_1 err_exit_1 LLR_01 Error Exit execute conditional operational branch guard_1->err_exit_1 YES (TRUE) guard_2 LLR_02: Guard Check Is `cardType` is not one of `MFB1_CARD through PSU_CARD`? guard_1->guard_2 err_exit_2 LLR_02 Error Exit abort processing and return `error status` guard_2->err_exit_2 YES (TRUE) act_3 LLR_03: Action Step invoke routine `memoryOper_set()` to execute target subsystem hardware operation guard_2->act_3 NO (FALSE) act_4 LLR_04: Action Step invoke routine `core_cardInfo()` to execute target subsystem hardware operation act_3->act_4 act_5 LLR_05: Action Step evaluate the driver return status using `errCheck()` act_4->act_5 act_6 LLR_06: Action Step invoke routine `extractInfo()` to execute target subsystem hardware operation act_5->act_6 act_7 LLR_07: Action Step invoke routine `fillUpAscii()` to execute target subsystem hardware operation act_6->act_7 success_exit LLR_08: Final Exit return `MD_SUCCESS` act_7->success_exit
Control Flow Diagram

Data Flow Diagram (DFD)

dfd_modInfo_getBrdInfo in_store Input Data Sources & Parameters • cardType (CardType) proc_1 LLR_01: Data Validation Check • Evaluate Parameter / State: brdInfoPtr in_store->proc_1 Validated Input Data proc_2 LLR_02: Data Validation Check • Evaluate Parameter / State: cardType proc_1->proc_2 Validated Input Data proc_3 LLR_03: Data Payload Transformation • Process payload via memoryOper_set() proc_2->proc_3 Data Payload (memoryOper_set) proc_4 LLR_04: Data Payload Transformation • Process payload via core_cardInfo() proc_3->proc_4 Data Payload (core_cardInfo) proc_5 LLR_05: Data Payload Transformation • Process payload via errCheck() proc_4->proc_5 Data Payload (errCheck) proc_6 LLR_06: Data Payload Transformation • Process payload via extractInfo() proc_5->proc_6 Data Payload (extractInfo) proc_7 LLR_07: Data Payload Transformation • Process payload via fillUpAscii() proc_6->proc_7 Data Payload (fillUpAscii) proc_8 LLR_08: Status Output Packaging • Format Return Payload: ModStatus proc_7->proc_8 Final Output Data out_sink Output Data Sinks & Status Return • brdInfoPtr (BoardInfo) proc_8->out_sink Output Data & Status Code
Data Flow Diagram
Here is the call graph for this function:
modInfo_getBrdInfo Node1 modInfo_getBrdInfo Node1->Node1 Node2 core_cardInfo Node1->Node2 Node6 errCheck Node1->Node6 Node7 extractInfo Node1->Node7 Node8 fillUpAscii Node1->Node8 Node2->Node2 Node3 interDrv_Read32 Node2->Node3 Node3->Node3 Node4 interDrv_isAddressValid Node3->Node4 Node5 memoryMap_Read32 Node3->Node5 Node4->Node4 Node5->Node5 Node6->Node6 Node7->Node7 Node7->Node8 Node8->Node8
Here is the caller graph for this function:
modInfo_getBrdInfo Node1 modInfo_getBrdInfo Node1->Node1

◆ modInfo_getDLMInfo()

ModStatus modInfo_getDLMInfo ( DLMInfo * dlmInfo)

modInfo_getDLMInfo.

Get Device Library Module Information.

Parameters
[out]dlmInfoDLM Information.
Returns
ModStatus - Module status return code, If no error occurs during the operation of the function, it returns MD_SUCCESS. Otherwise related error message is returned.
Return values
MD_SUCCESS: Success.
MD_INVALID_PARAM: The provided address pointer is invalid.

Low-Level Software Requirements (LLR)

Low-Level Requirement Specification: modInfo_getDLMInfo

Requirement ID Parent HLR ID Detailed Low-Level Requirement Statement (EARS Format) Software Unit Reference Verification Method Status
LLR_INFO_MODINFO_GETDLMINFO_01 HLR_IO_31356 WHEN the pointer dlmInfo is NULL (invalid), the modInfo_getDLMInfo() function SHALL abort processing and return MD_INVALID_PARAM. modInfo.c:modInfo_getDLMInfo() Test Closed
LLR_INFO_MODINFO_GETDLMINFO_02 HLR_IO_31356 WHEN preconditions are satisfied, the modInfo_getDLMInfo() function SHALL invoke routine memoryOper_set() to execute target subsystem hardware operation. modInfo.c:modInfo_getDLMInfo() Test Closed
LLR_INFO_MODINFO_GETDLMINFO_03 HLR_IO_31356 WHEN all operational processing completes successfully, the modInfo_getDLMInfo() function SHALL return MD_SUCCESS. modInfo.c:modInfo_getDLMInfo() Test Closed

Control Coupling Diagram (CCD)

ControlCouplingStructureChart Caller modInfo_getDLMInfo() [Device Library Modules] Target memoryOper_set() [Subordinate Routine] Caller:s->Target:n l_t0->l_b0   channelNum (Flag) l_t1->l_b1   opMode (Flag) r_b0->r_t0   statusCode (ModStatus)
Control Coupling Structure Chart

Data Coupling Diagram (DCD)

DataCouplingStructureChart Caller modInfo_getDLMInfo() [Device Library Modules] Target memoryOper_set() [Subordinate Routine] Caller:s->Target:n l_t0->l_b0   dataBufferPtr (Payload) r_b0->r_t0   *dlmInfo (Output Data)
Data Coupling Structure Chart

Control Flow Diagram (CFD)

cfd_modInfo_getDLMInfo start Entry: modInfo_getDLMInfo() guard_1 LLR_01: Guard Check Is the pointer `dlmInfo` is NULL (invalid)? start->guard_1 err_exit_1 LLR_01 Error Exit abort processing and return `MD_INVALID_PARAM` guard_1->err_exit_1 YES (TRUE) act_2 LLR_02: Action Step invoke routine `memoryOper_set()` to execute target subsystem hardware operation guard_1->act_2 NO (FALSE) success_exit LLR_03: Final Exit return `MD_SUCCESS` act_2->success_exit
Control Flow Diagram

Data Flow Diagram (DFD)

dfd_modInfo_getDLMInfo in_store Input Data Sources & Parameters • Function Inputs & Subsystem State proc_1 LLR_01: Data Validation Check • Evaluate Parameter / State: dlmInfo in_store->proc_1 Validated Input Data proc_2 LLR_02: Data Payload Transformation • Process payload via memoryOper_set() proc_1->proc_2 Data Payload (memoryOper_set) proc_3 LLR_03: Status Output Packaging • Format Return Payload: ModStatus proc_2->proc_3 Final Output Data out_sink Output Data Sinks & Status Return • dlmInfo (DLMInfo) proc_3->out_sink Output Data & Status Code
Data Flow Diagram
Here is the call graph for this function:
modInfo_getDLMInfo Node1 modInfo_getDLMInfo Node1->Node1
Here is the caller graph for this function:
modInfo_getDLMInfo Node1 modInfo_getDLMInfo Node1->Node1

Variable Documentation

◆ globalCard

CardInfo globalCard[MOD_INFO_MAX_CARD]
extern