Commit ff874261 authored by Jerome Hugues's avatar Jerome Hugues
Browse files

* Solve integration of VCD machinery

	Follow-up to openaadl/ocarina#96
parent ea07efa5
...@@ -19,21 +19,19 @@ ...@@ -19,21 +19,19 @@
*/ */
int __po_hi_compute_miss (__po_hi_uint8_t rate); int __po_hi_compute_miss (__po_hi_uint8_t rate);
unsigned long __po_hi_swap_byte (unsigned long value); unsigned long __po_hi_swap_byte (unsigned long value);
#ifdef __PO_HI_USE_VCD #ifdef __PO_HI_USE_VCD
#include <pthread.h> #include <pthread.h>
#include <string.h> #include <string.h>
/* Variable keeping track of whether VCD tracing is enabled or not */ /* Variable keeping track of whether VCD tracing is enabled or not */
#ifdef __PO_HI_USE_VCD
enum tagVCD { enum tagVCD {
VCD_UNCHECKED, VCD_UNCHECKED,
VCD_DISABLED, VCD_DISABLED,
VCD_ENABLED VCD_ENABLED
} VCD_state = UNCHECKED; };
#endif
void __po_hi_instrumentation_vcd_init (void); void __po_hi_instrumentation_vcd_init (void);
...@@ -41,12 +39,12 @@ void __po_hi_instrumentation_vcd_init (void); ...@@ -41,12 +39,12 @@ void __po_hi_instrumentation_vcd_init (void);
#define __PO_HI_INSTRUMENTATION_VCD_WRITE(s, args...) \ #define __PO_HI_INSTRUMENTATION_VCD_WRITE(s, args...) \
{ \ { \
extern enum tagVCD VCD_state; \
if (VCD_state == VCD_UNCHECKED) { \ if (VCD_state == VCD_UNCHECKED) { \
VCD_state = NULL == getenv("VCD_ENABLED")?VCD_DISABLED:VCD_ENABLED; \ VCD_state = NULL == getenv("VCD_ENABLED")?VCD_DISABLED:VCD_ENABLED; \
} \ } \
if (VCD_state == VCD_ENABLED) { \ if (VCD_state == VCD_ENABLED) { \
extern int __po_hi_vcd_file; \ extern int __po_hi_vcd_file; \
extern int __po_hi_vcd_init; \
extern __po_hi_time_t __po_hi_vcd_start_time; \ extern __po_hi_time_t __po_hi_vcd_start_time; \
extern pthread_mutex_t __po_hi_vcd_mutex; \ extern pthread_mutex_t __po_hi_vcd_mutex; \
__po_hi_time_t __po_hi_vcd_current_time; \ __po_hi_time_t __po_hi_vcd_current_time; \
...@@ -74,7 +72,7 @@ void __po_hi_instrumentation_vcd_init (void); ...@@ -74,7 +72,7 @@ void __po_hi_instrumentation_vcd_init (void);
write (__po_hi_vcd_file, buf, size_to_write); \ write (__po_hi_vcd_file, buf, size_to_write); \
} \ } \
pthread_mutex_unlock (&__po_hi_vcd_mutex); \ pthread_mutex_unlock (&__po_hi_vcd_mutex); \
} } \
} }
#else #else
#define __PO_HI_INSTRUMENTATION_VCD_WRITE(s, args...) #define __PO_HI_INSTRUMENTATION_VCD_WRITE(s, args...)
......
...@@ -5,13 +5,14 @@ ...@@ -5,13 +5,14 @@
* *
* For more informations, please visit http://taste.tuxfamily.org/wiki * For more informations, please visit http://taste.tuxfamily.org/wiki
* *
* Copyright (C) 2007-2009 Telecom ParisTech, 2010-2016 ESA & ISAE. * Copyright (C) 2007-2009 Telecom ParisTech, 2010-2017 ESA & ISAE.
*/ */
#include <po_hi_config.h> #include <po_hi_config.h>
#include <po_hi_time.h> #include <po_hi_time.h>
#include <po_hi_types.h> #include <po_hi_types.h>
#include <po_hi_debug.h> #include <po_hi_debug.h>
#include <po_hi_utils.h>
/* Header files in PolyORB-HI */ /* Header files in PolyORB-HI */
#include <deployment.h> #include <deployment.h>
...@@ -19,6 +20,10 @@ ...@@ -19,6 +20,10 @@
#include <stdlib.h> #include <stdlib.h>
#ifdef __PO_HI_USE_VCD
enum tagVCD VCD_state;
#endif
int __po_hi_compute_miss (__po_hi_uint8_t rate) int __po_hi_compute_miss (__po_hi_uint8_t rate)
{ {
int v; int v;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment