diff --git a/vhdlpp/architec.h b/vhdlpp/architec.h index 80a0c7140..508bb787a 100644 --- a/vhdlpp/architec.h +++ b/vhdlpp/architec.h @@ -1,7 +1,7 @@ #ifndef __architec_H #define __architec_H /* - * Copyright (c) 2011Stephen Williams (steve@icarus.com) + * Copyright (c) 2011 Stephen Williams (steve@icarus.com) * * This source code is free software; you can redistribute it * and/or modify it in source code form under the terms of the GNU @@ -139,7 +139,7 @@ class ProcessStatement : public Architecture::Statement { private: int rewrite_as_always_edge_(Entity*ent, Architecture*arc); - int extract_anyedge_(Entity*ent, Architecture*arc);; + int extract_anyedge_(Entity*ent, Architecture*arc); private: perm_string iname_; diff --git a/vpi/vcd_priv2.cc b/vpi/vcd_priv2.cc index 7b247ce0c..ac4a99364 100644 --- a/vpi/vcd_priv2.cc +++ b/vpi/vcd_priv2.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010 Stephen Williams (steve@icarus.com) + * Copyright (c) 2010-2011 Stephen Williams (steve@icarus.com) * * This source code is free software; you can redistribute it * and/or modify it in source code form under the terms of the GNU @@ -99,7 +99,7 @@ static pthread_cond_t work_queue_notempty_sig = PTHREAD_COND_INITIALIZER; static pthread_cond_t work_queue_minfree_sig = PTHREAD_COND_INITIALIZER; -struct vcd_work_item_s* vcd_work_thread_peek(void) +extern "C" struct vcd_work_item_s* vcd_work_thread_peek(void) { // There must always only be 1 vcd work thread, and only the // work thread decreases the fill, so if the work_queue_fill @@ -116,7 +116,7 @@ struct vcd_work_item_s* vcd_work_thread_peek(void) return work_queue + work_queue_next; } -void vcd_work_thread_pop(void) +extern "C" void vcd_work_thread_pop(void) { pthread_mutex_lock(&work_queue_mutex); @@ -217,7 +217,7 @@ static inline void unlock_item(bool flush_batch =false) end_batch(); } -void vcd_work_sync(void) +extern "C" void vcd_work_sync(void) { if (current_batch_alloc > 0) end_batch(); @@ -230,33 +230,33 @@ void vcd_work_sync(void) } } -void vcd_work_flush(void) +extern "C" extern "C" void vcd_work_flush(void) { struct vcd_work_item_s*cell = grab_item(); cell->type = WT_FLUSH; unlock_item(true); } -void vcd_work_dumpon(void) +extern "C" void vcd_work_dumpon(void) { struct vcd_work_item_s*cell = grab_item(); cell->type = WT_DUMPON; unlock_item(); } -void vcd_work_dumpoff(void) +extern "C" void vcd_work_dumpoff(void) { struct vcd_work_item_s*cell = grab_item(); cell->type = WT_DUMPOFF; unlock_item(); } -void vcd_work_set_time(uint64_t val) +extern "C" void vcd_work_set_time(uint64_t val) { work_queue_next_time = val; } -void vcd_work_emit_double(struct lxt2_wr_symbol*sym, double val) +extern "C" void vcd_work_emit_double(struct lxt2_wr_symbol*sym, double val) { struct vcd_work_item_s*cell = grab_item(); cell->type = WT_EMIT_DOUBLE; @@ -265,7 +265,7 @@ void vcd_work_emit_double(struct lxt2_wr_symbol*sym, double val) unlock_item(); } -void vcd_work_emit_bits(struct lxt2_wr_symbol*sym, const char* val) +extern "C" void vcd_work_emit_bits(struct lxt2_wr_symbol*sym, const char* val) { struct vcd_work_item_s*cell = grab_item(); @@ -276,7 +276,7 @@ void vcd_work_emit_bits(struct lxt2_wr_symbol*sym, const char* val) unlock_item(); } -void vcd_work_terminate(void) +extern "C" void vcd_work_terminate(void) { struct vcd_work_item_s*cell = grab_item(); cell->type = WT_TERMINATE; diff --git a/vpi/vhdl_table.cc b/vpi/vhdl_table.cc index 75d48df35..a01876d02 100644 --- a/vpi/vhdl_table.cc +++ b/vpi/vhdl_table.cc @@ -32,7 +32,7 @@ struct monitor_data { struct t_vpi_time last_event; }; -static PLI_INT32 monitor_events(struct t_cb_data*cb) +extern "C" PLI_INT32 monitor_events(struct t_cb_data*cb) { struct monitor_data*mon = reinterpret_cast (cb->user_data); @@ -43,7 +43,7 @@ static PLI_INT32 monitor_events(struct t_cb_data*cb) return 0; } -static PLI_INT32 ivlh_attribute_event_compiletf(ICARUS_VPI_CONST PLI_BYTE8*) +extern "C" PLI_INT32 ivlh_attribute_event_compiletf(ICARUS_VPI_CONST PLI_BYTE8*) { vpiHandle sys = vpi_handle(vpiSysTfCall, 0); vpiHandle argv = vpi_iterate(vpiArgument, sys); @@ -85,7 +85,7 @@ static PLI_INT32 ivlh_attribute_event_compiletf(ICARUS_VPI_CONST PLI_BYTE8*) return 0; } -static PLI_INT32 ivlh_attribute_event_calltf(ICARUS_VPI_CONST PLI_BYTE8*) +extern "C" PLI_INT32 ivlh_attribute_event_calltf(ICARUS_VPI_CONST PLI_BYTE8*) { vpiHandle sys = vpi_handle(vpiSysTfCall, 0); @@ -114,7 +114,7 @@ static PLI_INT32 ivlh_attribute_event_calltf(ICARUS_VPI_CONST PLI_BYTE8*) return 0; } -static void vhdl_register(void) +extern "C" void vhdl_register(void) { s_vpi_systf_data tf_data; @@ -123,11 +123,11 @@ static void vhdl_register(void) tf_data.calltf = ivlh_attribute_event_calltf; tf_data.compiletf = ivlh_attribute_event_compiletf; tf_data.sizetf = 0; - tf_data.user_data = "$ivlh_attribute_event"; + tf_data.user_data = (PLI_BYTE8 *) "$ivlh_attribute_event"; vpi_register_systf(&tf_data); } -void (*vlog_startup_routines[])() = { +extern "C" void (*vlog_startup_routines[])() = { vhdl_register, 0 };