#include <iverilog/vpi_user.h>
|
#include <iverilog/vpi_user.h>
|
|
|
#include "../../systemC/link_sc.h"
|
#include "../../systemC/link_sc.h"
|
|
|
int counter=0;
|
int counter=0;
|
int data_iteration_vlog=0;
|
int data_iteration_vlog=0;
|
int position=0;
|
int position=0;
|
|
|
#include <stdio.h>
|
#include <stdio.h>
|
#include <iostream>
|
#include <iostream>
|
#include <dlfcn.h>
|
#include <dlfcn.h>
|
#include <random>
|
#include <random>
|
#include <string.h>
|
#include <string.h>
|
|
|
using namespace std;
|
using namespace std;
|
|
|
void* lib_handle;
|
void* lib_handle;
|
|
|
Control_SC* (*create)();
|
Control_SC* (*create)();
|
void (*destroy)(Control_SC*);
|
void (*destroy)(Control_SC*);
|
|
|
Control_SC* SC_TOP;
|
Control_SC* SC_TOP;
|
|
|
s_vpi_value v_generate;
|
s_vpi_value v_generate;
|
|
|
s_vpi_value reset;
|
s_vpi_value reset;
|
s_vpi_value dout_value;
|
s_vpi_value dout_value;
|
s_vpi_value sout_value;
|
s_vpi_value sout_value;
|
s_vpi_value din_value;
|
s_vpi_value din_value;
|
s_vpi_value sin_value;
|
s_vpi_value sin_value;
|
s_vpi_value fsm_value;
|
s_vpi_value fsm_value;
|
s_vpi_value value_to_tx;
|
s_vpi_value value_to_tx;
|
s_vpi_value value_to_tx_timec;
|
s_vpi_value value_to_tx_timec;
|
s_vpi_value value_to_rx;
|
s_vpi_value value_to_rx;
|
|
|
s_vpi_value value_to_fsm;
|
s_vpi_value value_to_fsm;
|
|
|
s_vpi_value message_value;
|
s_vpi_value message_value;
|
|
|
s_vpi_value link_enable_value;
|
s_vpi_value link_enable_value;
|
s_vpi_value auto_start_value;
|
s_vpi_value auto_start_value;
|
s_vpi_value link_disable_value;
|
s_vpi_value link_disable_value;
|
|
|
#define SEND_DATA 0
|
#define SEND_DATA 0
|
#define WAIT_DATA 1
|
#define WAIT_DATA 1
|
|
|
#define SEND_TIME_CODE 0
|
#define SEND_TIME_CODE 0
|
#define WAIT_500_CYCLES 1
|
#define WAIT_500_CYCLES 1
|
|
|
|
unsigned int LOOPBACK_VLOG_EN = 0;
|
|
|
unsigned int state_test=0;
|
unsigned int state_test=0;
|
unsigned int state_test_tx_timec=0;
|
unsigned int state_test_tx_timec=0;
|
unsigned int timecode=0;
|
unsigned int timecode=0;
|
|
|
|
unsigned int data_rx_received_cnt=0;
|
|
unsigned int fct_send_cnt=0;
|
|
|
unsigned int state_test_rx=0;
|
unsigned int state_test_rx=0;
|
|
|
unsigned int counter_null=0;
|
unsigned int counter_null=0;
|
|
|
#include "run_sim.h"
|
#include "run_sim.h"
|
#include "global_init.h"
|
#include "global_init.h"
|
#include "global_reset.h"
|
#include "global_reset.h"
|
|
|
#include "write_fsm_spw_ultra_light.h"
|
#include "write_fsm_spw_ultra_light.h"
|
|
|
#include "write_tx_data_spw_ultra_light.h"
|
#include "write_tx_data_spw_ultra_light.h"
|
#include "write_tx_time_code_spw_ultra_light.h"
|
#include "write_tx_time_code_spw_ultra_light.h"
|
|
|
#include "receive_rx_data_spw_ultra_light.h"
|
#include "receive_rx_data_spw_ultra_light.h"
|
#include "receive_rx_time_code_spw_ultra_light.h"
|
#include "receive_rx_time_code_spw_ultra_light.h"
|
|
|
void interaction_register()
|
void interaction_register()
|
{
|
{
|
s_vpi_systf_data tf_data;
|
s_vpi_systf_data tf_data;
|
|
|
tf_data.type = vpiSysTask;
|
tf_data.type = vpiSysTask;
|
tf_data.sysfunctype = 0;
|
tf_data.sysfunctype = 0;
|
tf_data.tfname = "$run_sim";
|
tf_data.tfname = "$run_sim";
|
tf_data.calltf = run_sim_calltf;
|
tf_data.calltf = run_sim_calltf;
|
tf_data.compiletf = 0;
|
tf_data.compiletf = 0;
|
tf_data.sizetf = 0;
|
tf_data.sizetf = 0;
|
tf_data.user_data = 0;
|
tf_data.user_data = 0;
|
vpi_register_systf(&tf_data);
|
vpi_register_systf(&tf_data);
|
|
|
//
|
//
|
tf_data.type = vpiSysTask;
|
tf_data.type = vpiSysTask;
|
tf_data.sysfunctype = 0;
|
tf_data.sysfunctype = 0;
|
tf_data.tfname = "$write_tx_fsm_spw_ultra_light";
|
tf_data.tfname = "$write_tx_fsm_spw_ultra_light";
|
tf_data.calltf = write_tx_fsm_spw_ultra_light_calltf;
|
tf_data.calltf = write_tx_fsm_spw_ultra_light_calltf;
|
tf_data.compiletf = 0;
|
tf_data.compiletf = 0;
|
tf_data.sizetf = 0;
|
tf_data.sizetf = 0;
|
tf_data.user_data = 0;
|
tf_data.user_data = 0;
|
vpi_register_systf(&tf_data);
|
vpi_register_systf(&tf_data);
|
|
|
//
|
//
|
tf_data.type = vpiSysTask;
|
tf_data.type = vpiSysTask;
|
tf_data.sysfunctype = 0;
|
tf_data.sysfunctype = 0;
|
tf_data.tfname = "$write_tx_data_spw_ultra_light";
|
tf_data.tfname = "$write_tx_data_spw_ultra_light";
|
tf_data.calltf = write_tx_data_spw_ultra_light_calltf;
|
tf_data.calltf = write_tx_data_spw_ultra_light_calltf;
|
tf_data.compiletf = 0;
|
tf_data.compiletf = 0;
|
tf_data.sizetf = 0;
|
tf_data.sizetf = 0;
|
tf_data.user_data = 0;
|
tf_data.user_data = 0;
|
vpi_register_systf(&tf_data);
|
vpi_register_systf(&tf_data);
|
|
|
tf_data.type = vpiSysTask;
|
tf_data.type = vpiSysTask;
|
tf_data.sysfunctype = 0;
|
tf_data.sysfunctype = 0;
|
tf_data.tfname = "$write_tx_time_code_spw_ultra_light";
|
tf_data.tfname = "$write_tx_time_code_spw_ultra_light";
|
tf_data.calltf = write_tx_time_code_spw_ultra_light_calltf;
|
tf_data.calltf = write_tx_time_code_spw_ultra_light_calltf;
|
tf_data.compiletf = 0;
|
tf_data.compiletf = 0;
|
tf_data.sizetf = 0;
|
tf_data.sizetf = 0;
|
tf_data.user_data = 0;
|
tf_data.user_data = 0;
|
vpi_register_systf(&tf_data);
|
vpi_register_systf(&tf_data);
|
|
|
//
|
//
|
tf_data.type = vpiSysTask;
|
tf_data.type = vpiSysTask;
|
tf_data.sysfunctype = 0;
|
tf_data.sysfunctype = 0;
|
tf_data.tfname = "$receive_rx_data_spw_ultra_light";
|
tf_data.tfname = "$receive_rx_data_spw_ultra_light";
|
tf_data.calltf = receive_rx_data_spw_ultra_light_calltf;
|
tf_data.calltf = receive_rx_data_spw_ultra_light_calltf;
|
tf_data.compiletf = 0;
|
tf_data.compiletf = 0;
|
tf_data.sizetf = 0;
|
tf_data.sizetf = 0;
|
tf_data.user_data = 0;
|
tf_data.user_data = 0;
|
vpi_register_systf(&tf_data);
|
vpi_register_systf(&tf_data);
|
|
|
tf_data.type = vpiSysTask;
|
tf_data.type = vpiSysTask;
|
tf_data.sysfunctype = 0;
|
tf_data.sysfunctype = 0;
|
tf_data.tfname = "$receive_rx_time_code_spw_ultra_light";
|
tf_data.tfname = "$receive_rx_time_code_spw_ultra_light";
|
tf_data.calltf = receive_rx_time_code_spw_ultra_light_calltf;
|
tf_data.calltf = receive_rx_time_code_spw_ultra_light_calltf;
|
tf_data.compiletf = 0;
|
tf_data.compiletf = 0;
|
tf_data.sizetf = 0;
|
tf_data.sizetf = 0;
|
tf_data.user_data = 0;
|
tf_data.user_data = 0;
|
vpi_register_systf(&tf_data);
|
vpi_register_systf(&tf_data);
|
|
|
//
|
//
|
tf_data.type = vpiSysTask;
|
tf_data.type = vpiSysTask;
|
tf_data.sysfunctype = 0;
|
tf_data.sysfunctype = 0;
|
tf_data.tfname = "$global_reset";
|
tf_data.tfname = "$global_reset";
|
tf_data.calltf = global_reset_calltf;
|
tf_data.calltf = global_reset_calltf;
|
tf_data.compiletf = 0;
|
tf_data.compiletf = 0;
|
tf_data.sizetf = 0;
|
tf_data.sizetf = 0;
|
tf_data.user_data = 0;
|
tf_data.user_data = 0;
|
vpi_register_systf(&tf_data);
|
vpi_register_systf(&tf_data);
|
|
|
tf_data.type = vpiSysTask;
|
tf_data.type = vpiSysTask;
|
tf_data.sysfunctype = 0;
|
tf_data.sysfunctype = 0;
|
tf_data.tfname = "$global_init";
|
tf_data.tfname = "$global_init";
|
tf_data.calltf = global_init_calltf;
|
tf_data.calltf = global_init_calltf;
|
tf_data.compiletf = 0;
|
tf_data.compiletf = 0;
|
tf_data.sizetf = 0;
|
tf_data.sizetf = 0;
|
tf_data.user_data = 0;
|
tf_data.user_data = 0;
|
vpi_register_systf(&tf_data);
|
vpi_register_systf(&tf_data);
|
}
|
}
|
|
|
void (*vlog_startup_routines[])() = {
|
void (*vlog_startup_routines[])() = {
|
interaction_register,
|
interaction_register,
|
0
|
0
|
};
|
};
|
|
|
|
|