Transaction-Level Modeling Framework for Space Applications
#include <math.h>
#include <stdio.h>
#include <string.h>
Macros | |
#define | TRUE 1 |
#define | FALSE 0 |
#define | NOT ! |
#define | AND && |
#define | OR || |
#define | const static |
#define | dx int |
#define | d8 unsigned char |
#define | d32 unsigned long int |
#define | UNDEFINED |
#define | EVEN_PARITY_MASK 0x00000001 |
#define | ERROR_MASK 0x00000001 |
#define | BIT_MASK 0x80000000 |
#define | MAX_MSG 256 /* maximum length of message */ |
#define | PREAMBLE 0xaaaaaaaa /* preamble pattern */ |
#define | POCSAG_SYNC 0x3e4ba81b /* POCSAG sync word */ |
#define | CAPCODE_A 0x2a74e /* 19-bit Capcode A */ |
#define | CAPCODE_B 0x1d25a /* 19-bit Capcode B */ |
#define | MSG_MASK 0xfffff /* 20-bit data message mask */ |
#define | ALPHA_MASK 0x7f /* 7-bit mask for alphanumeric data */ |
#define | NUM_MASK 0xf /* 4-bit mask for numeric data */ |
#define | FUNC_MASK 0x3 /* 2-bit function code mask */ |
#define | BAD_BYTE 0x80 /* bad message byte (uncorrectable) */ |
Functions | |
d32 | error_corr (register d32) |
void | fix_bit (register char) |
void | find_syndromes (void) |
char | normalized_locator (void) |
void | validation (void) |
dx | comp32 (register d32, register d32) |
d32 * | sync_find (register d32 *) |
dx | addr_corr (register d32) |
dx | num_proc (register dx, register d32) |
dx | alpha_proc (register dx, register d32) |
dx | msg_proc (register d32 *) |
int | main (void) |
d32 | err_corr (register d32 datain) |
Variables | |
d32 | hexword |
d32 | parity |
dx | error_code |
char | s1 |
char | s3 |
const char | alpha [] |
const char | alpha3 [] |
const char | alpha_inv [] |
const char | roots [] |
d8 | msg [MAX_MSG] |
dx | alpha_count =0 |
dx | func |
const d8 | err_tab [] |
unsigned long | alpha_data [] |
unsigned long | numeric_data [] |
#define ALPHA_MASK 0x7f /* 7-bit mask for alphanumeric data */ |
Referenced by alpha_proc().
#define AND && |
#define BAD_BYTE 0x80 /* bad message byte (uncorrectable) */ |
Referenced by alpha_proc(), and num_proc().
#define BIT_MASK 0x80000000 |
Referenced by find_syndromes().
#define CAPCODE_A 0x2a74e /* 19-bit Capcode A */ |
Referenced by addr_corr(), and msg_proc().
#define CAPCODE_B 0x1d25a /* 19-bit Capcode B */ |
Referenced by addr_corr(), and msg_proc().
#define const static |
#define d32 unsigned long int |
Referenced by addr_corr(), find_syndromes(), main(), msg_proc(), and sync_find().
#define d8 unsigned char |
Referenced by addr_corr(), alpha_proc(), comp32(), and num_proc().
#define dx int |
Referenced by addr_corr(), alpha_proc(), comp32(), find_syndromes(), main(), msg_proc(), num_proc(), and sync_find().
#define ERROR_MASK 0x00000001 |
Referenced by fix_bit().
#define EVEN_PARITY_MASK 0x00000001 |
Referenced by find_syndromes().
#define FALSE 0 |
Referenced by addr_corr(), and msg_proc().
#define FUNC_MASK 0x3 /* 2-bit function code mask */ |
Referenced by addr_corr().
#define MAX_MSG 256 /* maximum length of message */ |
#define MSG_MASK 0xfffff /* 20-bit data message mask */ |
Referenced by msg_proc().
#define NOT ! |
#define NUM_MASK 0xf /* 4-bit mask for numeric data */ |
Referenced by num_proc().
#define OR || |
Referenced by msg_proc(), and sync_find().
#define POCSAG_SYNC 0x3e4ba81b /* POCSAG sync word */ |
Referenced by msg_proc(), and sync_find().
#define PREAMBLE 0xaaaaaaaa /* preamble pattern */ |
Referenced by sync_find().
#define TRUE 1 |
Referenced by addr_corr(), and msg_proc().
#define UNDEFINED |
References alpha_count, ALPHA_MASK, BAD_BYTE, d8, dx, error_code, i, and msg.
References error_code, find_syndromes(), fix_bit(), hexword, normalized_locator(), parity, and s1.
d32 error_corr | ( | register | d32 | ) |
void find_syndromes | ( | void | ) |
void fix_bit | ( | register char | eroot | ) |
References ERROR_MASK, and hexword.
int main | ( | void | ) |
References alpha_count, alpha_data, d32, dx, func, msg, msg_proc(), numeric_data, and sync_find().
References addr_corr(), alpha_proc(), CAPCODE_A, CAPCODE_B, comp32(), d32, dx, err_corr(), error_code, FALSE, func, i, MSG_MASK, num_proc(), OR, POCSAG_SYNC, and TRUE.
void validation | ( | void | ) |
dx alpha_count =0 |
unsigned long alpha_data[] |
dx error_code |
dx func |
d32 hexword |
unsigned long numeric_data[] |
d32 parity |
char s1 |
char s3 |