Skip to content

Commit

Permalink
.c/.h whitespace removal
Browse files Browse the repository at this point in the history
  • Loading branch information
ruck314 committed Sep 22, 2023
1 parent d819996 commit 24dd43c
Show file tree
Hide file tree
Showing 21 changed files with 539 additions and 539 deletions.
24 changes: 12 additions & 12 deletions axi/simlink/src/RogueSideBand.c
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
//////////////////////////////////////////////////////////////////////////////
// This file is part of 'SLAC Firmware Standard Library'.
// It is subject to the license terms in the LICENSE.txt file found in the
// top-level directory of this distribution and at:
// https://confluence.slac.stanford.edu/display/ppareg/LICENSE.html.
// No part of 'SLAC Firmware Standard Library', including this file,
// may be copied, modified, propagated, or distributed except according to
// It is subject to the license terms in the LICENSE.txt file found in the
// top-level directory of this distribution and at:
// https://confluence.slac.stanford.edu/display/ppareg/LICENSE.html.
// No part of 'SLAC Firmware Standard Library', including this file,
// may be copied, modified, propagated, or distributed except according to
// the terms contained in the LICENSE.txt file.
//////////////////////////////////////////////////////////////////////////////

Expand All @@ -27,17 +27,17 @@
void RogueSideBandRestart(RogueSideBandData *data, portDataT *portData) {
char buffer[100];

if ( data->zmqPush != NULL ) zmq_close(data->zmqPush );
if ( data->zmqPush != NULL ) zmq_close(data->zmqPush );
if ( data->zmqPull != NULL ) zmq_close(data->zmqPull);
if ( data->zmqCtx != NULL ) zmq_term(data->zmqCtx);

data->zmqCtx = NULL;
data->zmqPush = NULL;
data->zmqPull = NULL;

data->zmqCtx = zmq_ctx_new();
data->zmqPull = zmq_socket(data->zmqCtx,ZMQ_PULL);
data->zmqPush = zmq_socket(data->zmqCtx,ZMQ_PUSH);
data->zmqPush = zmq_socket(data->zmqCtx,ZMQ_PUSH);

vhpi_printf("RogueSideBand: Listening on ports %i & %i\n",data->port, data->port+1);

Expand All @@ -52,7 +52,7 @@ void RogueSideBandRestart(RogueSideBandData *data, portDataT *portData) {
vhpi_assert("RogueSideBand: Failed to bind push port",vhpiFatal);
return;
}

}

// Send a message
Expand All @@ -61,7 +61,7 @@ void RogueSideBandSend ( RogueSideBandData *data, portDataT *portData ) {
uint8_t ba[4];
char buffer[200];

if ( (zmq_msg_init_size(&msg,4) < 0) ) {
if ( (zmq_msg_init_size(&msg,4) < 0) ) {
vhpi_assert("RogueSideBand: Failed to init message",vhpiFatal);
return;
}
Expand Down Expand Up @@ -119,7 +119,7 @@ int RogueSideBandRecv ( RogueSideBandData *data, portDataT *portData ) {
}

// Init function
void RogueSideBandInit(vhpiHandleT compInst) {
void RogueSideBandInit(vhpiHandleT compInst) {

// Create new port data structure
portDataT *portData = (portDataT *) malloc(sizeof(portDataT));
Expand Down Expand Up @@ -188,7 +188,7 @@ void RogueSideBandUpdate ( void *userPtr ) {
data->rxOpCode = 0x00;
data->rxOpCodeEn = 0;
data->txRemData = 0x00;
data->txRemDataChanged = 0x00;
data->txRemDataChanged = 0x00;
data->txOpCode = 0x00;
data->txOpCodeEn = 0;
setInt(s_rxOpCodeEn,0);
Expand Down
18 changes: 9 additions & 9 deletions axi/simlink/src/RogueSideBand.h
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
//////////////////////////////////////////////////////////////////////////////
// This file is part of 'SLAC Firmware Standard Library'.
// It is subject to the license terms in the LICENSE.txt file found in the
// top-level directory of this distribution and at:
// https://confluence.slac.stanford.edu/display/ppareg/LICENSE.html.
// No part of 'SLAC Firmware Standard Library', including this file,
// may be copied, modified, propagated, or distributed except according to
// It is subject to the license terms in the LICENSE.txt file found in the
// top-level directory of this distribution and at:
// https://confluence.slac.stanford.edu/display/ppareg/LICENSE.html.
// No part of 'SLAC Firmware Standard Library', including this file,
// may be copied, modified, propagated, or distributed except according to
// the terms contained in the LICENSE.txt file.
//////////////////////////////////////////////////////////////////////////////

Expand Down Expand Up @@ -35,20 +35,20 @@ typedef struct {

uint32_t currClk;
uint16_t port;

uint8_t rxRemData;
uint8_t rxOpCode;
uint8_t rxOpCodeEn;

uint8_t txRemData;
uint8_t txRemDataChanged;
uint8_t txRemDataChanged;
uint8_t txOpCode;
uint8_t txOpCodeEn;

void * zmqCtx;
void * zmqPull;
void * zmqPush;
void * zmqPush;

} RogueSideBandData;

// Init function
Expand Down
36 changes: 18 additions & 18 deletions axi/simlink/src/RogueTcpMemory.c
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
//////////////////////////////////////////////////////////////////////////////
// This file is part of 'SLAC Firmware Standard Library'.
// It is subject to the license terms in the LICENSE.txt file found in the
// top-level directory of this distribution and at:
// https://confluence.slac.stanford.edu/display/ppareg/LICENSE.html.
// No part of 'SLAC Firmware Standard Library', including this file,
// may be copied, modified, propagated, or distributed except according to
// It is subject to the license terms in the LICENSE.txt file found in the
// top-level directory of this distribution and at:
// https://confluence.slac.stanford.edu/display/ppareg/LICENSE.html.
// No part of 'SLAC Firmware Standard Library', including this file,
// may be copied, modified, propagated, or distributed except according to
// the terms contained in the LICENSE.txt file.
//////////////////////////////////////////////////////////////////////////////

Expand Down Expand Up @@ -34,7 +34,7 @@ void RogueTcpMemoryRestart(RogueTcpMemoryData *data, portDataT *portData) {
data->zmqCtx = NULL;
data->zmqPull = NULL;
data->zmqPush = NULL;

data->zmqCtx = zmq_ctx_new();
data->zmqPull = zmq_socket(data->zmqCtx,ZMQ_PULL);
data->zmqPush = zmq_socket(data->zmqCtx,ZMQ_PUSH);
Expand All @@ -61,9 +61,9 @@ void RogueTcpMemorySend ( RogueTcpMemoryData *data, portDataT *portData ) {
zmq_msg_t msg[6];

if ( (zmq_msg_init_size(&(msg[0]),4) < 0) || // ID
(zmq_msg_init_size(&(msg[1]),8) < 0) || // Addr
(zmq_msg_init_size(&(msg[2]),4) < 0) || // Size
(zmq_msg_init_size(&(msg[3]),4) < 0) || // type
(zmq_msg_init_size(&(msg[1]),8) < 0) || // Addr
(zmq_msg_init_size(&(msg[2]),4) < 0) || // Size
(zmq_msg_init_size(&(msg[3]),4) < 0) || // type
(zmq_msg_init_size(&(msg[5]),4) < 0) ) { // result
vhpi_assert("RogueTcpMemory: Failed to init message header",vhpiFatal);
return;
Expand All @@ -82,7 +82,7 @@ void RogueTcpMemorySend ( RogueTcpMemoryData *data, portDataT *portData ) {

// Copy data
memcpy(zmq_msg_data(&(msg[4])),data->data,data->size);

// Send data
for (x=0; x < 6; x++) {
if ( zmq_sendmsg(data->zmqPush,&(msg[x]),(x==5)?0:ZMQ_SNDMORE) < 0 )
Expand Down Expand Up @@ -162,7 +162,7 @@ int RogueTcpMemoryRecv ( RogueTcpMemoryData *data, portDataT *portData ) {
}

// Init function
void RogueTcpMemoryInit(vhpiHandleT compInst) {
void RogueTcpMemoryInit(vhpiHandleT compInst) {

// Create new port data structure
portDataT *portData = (portDataT *) malloc(sizeof(portDataT));
Expand All @@ -172,9 +172,9 @@ void RogueTcpMemoryInit(vhpiHandleT compInst) {
portData->portCount = PORT_COUNT;

// Set port directions
portData->portDir[s_clock] = vhpiIn;
portData->portDir[s_reset] = vhpiIn;
portData->portDir[s_port] = vhpiIn;
portData->portDir[s_clock] = vhpiIn;
portData->portDir[s_reset] = vhpiIn;
portData->portDir[s_port] = vhpiIn;

portData->portDir[s_araddr] = vhpiOut;
portData->portDir[s_arprot] = vhpiOut;
Expand All @@ -200,9 +200,9 @@ void RogueTcpMemoryInit(vhpiHandleT compInst) {
portData->portDir[s_bvalid] = vhpiIn;

// Set port widths
portData->portWidth[s_clock] = 1;
portData->portWidth[s_reset] = 1;
portData->portWidth[s_port] = 16;
portData->portWidth[s_clock] = 1;
portData->portWidth[s_reset] = 1;
portData->portWidth[s_port] = 16;

portData->portWidth[s_araddr] = 32;
portData->portWidth[s_arprot] = 3;
Expand Down Expand Up @@ -262,7 +262,7 @@ void RogueTcpMemoryUpdate ( void *userPtr ) {
setInt(s_rready,1);
setInt(s_awvalid,0);
setInt(s_bready,1);
}
}

// Data movement
else {
Expand Down
18 changes: 9 additions & 9 deletions axi/simlink/src/RogueTcpMemory.h
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
//////////////////////////////////////////////////////////////////////////////
// This file is part of 'SLAC Firmware Standard Library'.
// It is subject to the license terms in the LICENSE.txt file found in the
// top-level directory of this distribution and at:
// https://confluence.slac.stanford.edu/display/ppareg/LICENSE.html.
// No part of 'SLAC Firmware Standard Library', including this file,
// may be copied, modified, propagated, or distributed except according to
// It is subject to the license terms in the LICENSE.txt file found in the
// top-level directory of this distribution and at:
// https://confluence.slac.stanford.edu/display/ppareg/LICENSE.html.
// No part of 'SLAC Firmware Standard Library', including this file,
// may be copied, modified, propagated, or distributed except according to
// the terms contained in the LICENSE.txt file.
//////////////////////////////////////////////////////////////////////////////

Expand Down Expand Up @@ -66,20 +66,20 @@ typedef struct {
uint8_t arprot;
uint8_t arvalid;
uint8_t rready;

uint8_t arready;
uint32_t rdata;
uint8_t rresp;
uint8_t rvalid;

uint32_t awaddr;
uint8_t awprot;
uint8_t awvalid;
uint32_t wdata;
uint8_t wstrb;
uint8_t wvalid;
uint8_t bready;

uint8_t awready;
uint8_t wready;
uint8_t bresp;
Expand All @@ -100,7 +100,7 @@ typedef struct {
void * zmqCtx;
void * zmqPull;
void * zmqPush;

} RogueTcpMemoryData;

// Init function
Expand Down
32 changes: 16 additions & 16 deletions axi/simlink/src/RogueTcpStream.c
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
//////////////////////////////////////////////////////////////////////////////
// This file is part of 'SLAC Firmware Standard Library'.
// It is subject to the license terms in the LICENSE.txt file found in the
// top-level directory of this distribution and at:
// https://confluence.slac.stanford.edu/display/ppareg/LICENSE.html.
// No part of 'SLAC Firmware Standard Library', including this file,
// may be copied, modified, propagated, or distributed except according to
// It is subject to the license terms in the LICENSE.txt file found in the
// top-level directory of this distribution and at:
// https://confluence.slac.stanford.edu/display/ppareg/LICENSE.html.
// No part of 'SLAC Firmware Standard Library', including this file,
// may be copied, modified, propagated, or distributed except according to
// the terms contained in the LICENSE.txt file.
//////////////////////////////////////////////////////////////////////////////

Expand Down Expand Up @@ -35,7 +35,7 @@ void RogueTcpStreamRestart(RogueTcpStreamData *data, portDataT *portData) {
data->zmqCtx = NULL;
data->zmqPush = NULL;
data->zmqPull = NULL;

data->zmqCtx = zmq_ctx_new();
data->zmqPull = zmq_socket(data->zmqCtx,ZMQ_PULL);
data->zmqPush = zmq_socket(data->zmqCtx,ZMQ_PUSH);
Expand Down Expand Up @@ -93,7 +93,7 @@ void RogueTcpStreamSend ( RogueTcpStreamData *data, portDataT *portData ) {

// Copy data
memcpy(zmq_msg_data(&(msg[3])),data->ibData,data->ibSize);

// Send data
for (x=0; x < 4; x++) {
if ( zmq_msg_send(&(msg[x]), data->zmqPush, (x==3)?0:ZMQ_SNDMORE) < 0 ) {
Expand Down Expand Up @@ -180,7 +180,7 @@ int RogueTcpStreamRecv ( RogueTcpStreamData *data, portDataT *portData ) {


// Init function
void RogueTcpStreamInit(vhpiHandleT compInst) {
void RogueTcpStreamInit(vhpiHandleT compInst) {

// Create new port data structure
portDataT *portData = (portDataT *) malloc(sizeof(portDataT));
Expand All @@ -190,10 +190,10 @@ void RogueTcpStreamInit(vhpiHandleT compInst) {
portData->portCount = PORT_COUNT;

// Set port directions
portData->portDir[s_clock] = vhpiIn;
portData->portDir[s_reset] = vhpiIn;
portData->portDir[s_port] = vhpiIn;
portData->portDir[s_ssi] = vhpiIn;
portData->portDir[s_clock] = vhpiIn;
portData->portDir[s_reset] = vhpiIn;
portData->portDir[s_port] = vhpiIn;
portData->portDir[s_ssi] = vhpiIn;

portData->portDir[s_obValid] = vhpiOut;
portData->portDir[s_obReady] = vhpiIn;
Expand All @@ -204,7 +204,7 @@ void RogueTcpStreamInit(vhpiHandleT compInst) {
portData->portDir[s_obKeep] = vhpiOut;
portData->portDir[s_obLast] = vhpiOut;

portData->portDir[s_ibValid] = vhpiIn;
portData->portDir[s_ibValid] = vhpiIn;
portData->portDir[s_ibReady] = vhpiOut;
portData->portDir[s_ibDataLow] = vhpiIn;
portData->portDir[s_ibDataHigh] = vhpiIn;
Expand Down Expand Up @@ -285,7 +285,7 @@ void RogueTcpStreamUpdate ( void *userPtr ) {
setInt(s_obUserHigh,0);
setInt(s_obKeep,0);
setInt(s_obLast,0);
}
}

// Data movement
else {
Expand Down Expand Up @@ -341,7 +341,7 @@ void RogueTcpStreamUpdate ( void *userPtr ) {
if ( data->obCount == 0 ) setInt(s_obUserLow,data->obFuser);
else setInt(s_obUserLow,0);
setInt(s_obUserHigh,0);

// Get data
dHigh = 0;
dLow = 0;
Expand All @@ -362,7 +362,7 @@ void RogueTcpStreamUpdate ( void *userPtr ) {
}
else {
dHigh |= (data->obData[data->obCount] << ((x-4)*8));
if ( (data->obCount+1) == data->obSize )
if ( (data->obCount+1) == data->obSize )
setInt(s_obUserHigh,(data->obLuser << ((x-4)*8)));
}

Expand Down
14 changes: 7 additions & 7 deletions axi/simlink/src/RogueTcpStream.h
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
//////////////////////////////////////////////////////////////////////////////
// This file is part of 'SLAC Firmware Standard Library'.
// It is subject to the license terms in the LICENSE.txt file found in the
// top-level directory of this distribution and at:
// https://confluence.slac.stanford.edu/display/ppareg/LICENSE.html.
// No part of 'SLAC Firmware Standard Library', including this file,
// may be copied, modified, propagated, or distributed except according to
// It is subject to the license terms in the LICENSE.txt file found in the
// top-level directory of this distribution and at:
// https://confluence.slac.stanford.edu/display/ppareg/LICENSE.html.
// No part of 'SLAC Firmware Standard Library', including this file,
// may be copied, modified, propagated, or distributed except according to
// the terms contained in the LICENSE.txt file.
//////////////////////////////////////////////////////////////////////////////

Expand Down Expand Up @@ -62,11 +62,11 @@ typedef struct {
uint16_t port;
uint8_t ssi;
time_t ltime;

void * zmqCtx;
void * zmqPush;
void * zmqPull;

} RogueTcpStreamData;

// Init function
Expand Down
Loading

0 comments on commit 24dd43c

Please sign in to comment.