#ifndef _VM_HDL_H_ #define _VM_HDL_H_ // accessible functions extern void init_VM_lib(unsigned int *p_timer_ctrl_val, unsigned int * p_timer_load_val, int irq_number_val, unsigned int * p_tx_reg, int spec_table_len); extern void start_VM (int VM_program); extern void stop_VM (void); extern void VM_init_spec_table(unsigned int * Conf_Spectroscopy_table, int word_num); extern void prepare_VM_total_power(unsigned int aid, unsigned int flush_event, unsigned int mon_event); extern void prepare_VM_slow_chop(unsigned int aid, unsigned int flush_event, unsigned int mon_event, unsigned int rot1, unsigned int rot2); extern void prepare_VM_freq_switch(unsigned int aid, unsigned int flush_event, unsigned int mon_event, unsigned int freq1, unsigned int freq2); extern void prepare_VM_fast_chop(unsigned int aid, unsigned int flush_event, unsigned int mon_event, unsigned int rot1, unsigned int rot2, unsigned int n_wbs, unsigned int hrs_trans, unsigned int hrs_per_wbs_idx); // accessible global variables extern unsigned int EndProg; // may be useful to inspect the state of the VM as well as to abort the execution of a program; extern volatile unsigned int Irq3_flag; extern unsigned int Code[]; // VM program memory extern unsigned int * VM_Spectroscopy_table; // accessible defines #define VM_LEN 8192 #define VM_AID_spectroscopy (Code[VM_LEN - WNUM_Spectroscopy_table + AID_SP_IDX]) #define VMPROG_TOTAL_POWER 0 #define VMPROG_SLOW_CHOP 1 #define VMPROG_FREQ_SWITCH 1 #define VMPROG_FAST_CHOP 2 #define AID_SP_IDX 64 #define VM_RELEASE_IDX 67 #define HIF_EVENT_CODE_IDX 68 /* store here the Virtuoso event to raise upon measurement completion */ #define HIF_EVENT_COUNTER_CODE_IDX 69 /* store here the event to raise upond start integration or transfer request */ #define VM_START_INT_WBS_IDX 70 /* counter for the integration req to wbs */ #define VM_START_INT_HRS_IDX 71 /* counter for the integration req to hrs */ #define VM_START_TRANSF_WBS_H_IDX 72 /* counter for the transfer req to wbs h */ #define VM_START_TRANSF_WBS_V_IDX 73 /* counter for the transfer req to wbs v */ #define VM_START_TRANSF_HRS_H_IDX 74 /* counter for the transfer req to hrs h */ #define VM_START_TRANSF_HRS_V_IDX 75 /* counter for the transfer req to hrs v */ #define HIF_N_WBS1_IDX 30 /* store here the number of repetition of the first cycle of fast chop */ #define HIF_N_HRS_TRANS_IDX 31 /* store here the number of repetition of the second cycle of fast chop */ #define HIF_CPR_CH_ROT1_IDX 32 /* store here chopper position 1 in slow and fast chop meas */ #define HIF_CPR_CH_ROT2_IDX 33 /* store here chopper position 2 in slow and fast chop meas */ #define HIF_FREQ1_IDX 32 /* store here frequency 1 in freq switch meas */ #define HIF_FREQ2_IDX 33 /* store here frequency 1 in freq switch meas */ /*-------------- library internal use -------------------------------- */ extern unsigned int * P_hw_timer_ctrl; extern unsigned int * P_hw_timer; // Points to the HW timer register extern unsigned int * TX_reg; extern unsigned int ProgC; // VM Program Counter extern int SUbind; #ifndef TRUE #define TRUE 1 #endif #ifndef FALSE #define FALSE 0 #endif #endif