New backend (with M2I40xx ADC card)

* enabled fc1_backend with M2I40xx ADC card
* debian package now depends also on the spcm and libspcm-linux kernel
* module and library from Spectrum
This commit is contained in:
Markus Rosenstihl 2017-03-10 13:20:44 +01:00
parent f0e9f43f2e
commit 449ae0c9ef
8 changed files with 32 additions and 27 deletions

4
debian/control vendored
View File

@ -14,7 +14,7 @@ Build-Depends: debhelper (>=7),
Package: damaris-backends Package: damaris-backends
Architecture: i386 amd64 Architecture: i386 amd64
Depends: ${misc:Depends},${shlibs:Depends}, bash (>=4.2), kmod, coreutils (>=8.13), libxerces-c3.1|libxerces-c-dev, udev, libglib2.0-0 Depends: ${misc:Depends},${shlibs:Depends}, bash (>=4.2), kmod, coreutils (>=8.13), libxerces-c3.1|libxerces-c-dev, udev, libglib2.0-0, libspcm-linux, spcm
Recommends: python-damaris|damaris-frontend, damaris-modules Recommends: python-damaris|damaris-frontend, damaris-modules
Description: DAMARIS backends package Description: DAMARIS backends package
This is the DAMARIS backends package. It contains machine definitions This is the DAMARIS backends package. It contains machine definitions
@ -23,7 +23,7 @@ Description: DAMARIS backends package
Package: damaris-modules Package: damaris-modules
Architecture: i386 amd64 Architecture: i386 amd64
Recommends: damaris-backends Recommends: damaris-backends
Depends: ${misc:Depends}, kmod Depends: ${misc:Depends}, kmod, spcm
Replaces: damaris-backends (<= 0.13-0.5) Replaces: damaris-backends (<= 0.13-0.5)
Description: Kernel modules for DAMARIS hardware Description: Kernel modules for DAMARIS hardware
This are kernel modules for DAMARIS compatible hardware. This are kernel modules for DAMARIS compatible hardware.

View File

@ -1,6 +1,5 @@
cmake_minimum_required(VERSION 3.0) cmake_minimum_required(VERSION 3.0)
# unpack headers needed # unpack headers needed
set(SPC_DRV drv_header_v402b6844.zip) set(SPC_DRV drv_header_v402b6844.zip)
set(SPC_HEADERS set(SPC_HEADERS
@ -26,8 +25,8 @@ if(DEFINED ENV{SPC_SOURCE})
message(STATUS "SPC_SOURCE environment variable set" $ENV{SPC_SOURCE}) message(STATUS "SPC_SOURCE environment variable set" $ENV{SPC_SOURCE})
set(SPC_SRC $ENV{SPC_SOURCE}) set(SPC_SRC $ENV{SPC_SOURCE})
else() else()
message(WARNING "Spectrum driver source path not defined in envirnoment variable SPC_SOURCE")
set(SPC_SRC ${CMAKE_CURRENT_SOURCE_DIR}/linux/src_all/micx_drv) set(SPC_SRC ${CMAKE_CURRENT_SOURCE_DIR}/linux/src_all/micx_drv)
message(WARNING "Spectrum driver source path not defined in envirnoment variable SPC_SOURCE, using default:" ${SPC_SOURCE})
endif() endif()
set(DRIVER_FILE ${SPC_SRC}/spc_smp.ko ) set(DRIVER_FILE ${SPC_SRC}/spc_smp.ko )
set(KERNEL_DIR "/lib/modules/${CMAKE_SYSTEM_VERSION}/build" ) set(KERNEL_DIR "/lib/modules/${CMAKE_SYSTEM_VERSION}/build" )

View File

@ -4,8 +4,8 @@ AR=ar
SPC_HEADERS = include/spcerr.h include/regs.h include/dlltyp.h include/spcioctl.inc SPC_HEADERS = include/spcerr.h include/regs.h include/dlltyp.h include/spcioctl.inc
SPC_ZIP = ../Spectrum-M2i40xxSeries/drv_spcm_linux_drv_v214b5633.zip #SPC_ZIP = ../Spectrum-M2i40xxSeries/drv_spcm_linux_drv_v214b5633.zip
#SPC_ZIP = ../Spectrum-MI40xxSeries/drv_header_v402b6844.zip SPC_ZIP = ../Spectrum-MI40xxSeries/drv_header_v402b6844.zip
all: clean $(SPC_HEADERS) patch Spectrum-MI40xxSeries.a hw_test_int hw_test_ext all: clean $(SPC_HEADERS) patch Spectrum-MI40xxSeries.a hw_test_int hw_test_ext

View File

@ -10,10 +10,10 @@
#include <fcntl.h> #include <fcntl.h>
#include <sys/ioctl.h> #include <sys/ioctl.h>
#include "dlltyp.h" #include "include/dlltyp.h"
#include "regs.h" #include "include/regs.h"
#include "spcerr.h" #include "include/spcerr.h"
#include "spcioctl.inc" #include "include/spcioctl.inc"
// ----- main task ----- // ----- main task -----

View File

@ -10,10 +10,10 @@
#include <fcntl.h> #include <fcntl.h>
#include <sys/ioctl.h> #include <sys/ioctl.h>
#include "dlltyp.h" #include "include/dlltyp.h"
#include "regs.h" #include "include/regs.h"
#include "spcerr.h" #include "include/spcerr.h"
#include "spcioctl.inc" #include "include/spcioctl.inc"
// ----- main task ----- // ----- main task -----

View File

@ -178,11 +178,9 @@ void SpinCorePulseBlaster::run_pulse_program_w_sync(state& exp, double sync_freq
c=prog->create_command(); c=prog->create_command();
c->ttls=sync_mask; c->ttls=sync_mask;
c->instruction=SpinCorePulseBlaster::WAIT; c->instruction=SpinCorePulseBlaster::WAIT;
c->length=shortest_pulse; c->length=shortest_pulse*2.0;
prog->push_front(c); prog->push_front(c);
if (1) { if (1) {
// zeroth command: pulse before WAIT opcode needs to be at least 120ns // zeroth command: pulse before WAIT opcode needs to be at least 120ns
@ -190,10 +188,11 @@ void SpinCorePulseBlaster::run_pulse_program_w_sync(state& exp, double sync_freq
// reported to SpinCore (Contact Request 2016-12-19 at 1482143561) // reported to SpinCore (Contact Request 2016-12-19 at 1482143561)
// markusro: When is this necessary? (TODO) // markusro: When is this necessary? (TODO)
c=prog->create_command(); c=prog->create_command();
c->ttls=sync_mask; //c->ttls=sync_mask;
c->ttls = 0x0;
c->instruction=SpinCorePulseBlaster::CONTINUE; c->instruction=SpinCorePulseBlaster::CONTINUE;
//c->length=shortest_pulse+2; // markusro: why +2 ?? //c->length=shortest_pulse+2; //
c->length=12; // markusro: why +2 ?? c->length=12; // markusro: why shortest_pulse+2=11 , tests show 120 ns minimum state time??
prog->push_front(c); prog->push_front(c);
} }
duration+=2.0*shortest_pulse/clock+1.0/sync_freq; duration+=2.0*shortest_pulse/clock+1.0/sync_freq;

View File

@ -56,9 +56,14 @@ add_executable(fc1neu_backend fc1neu_backend.cpp hardware.cpp)
target_link_libraries( fc1neu_backend pthread ${XERCES_LIBRARIES} core Spectrum_MI40xxSeries ${PB24} PTS DAC20 ) target_link_libraries( fc1neu_backend pthread ${XERCES_LIBRARIES} core Spectrum_MI40xxSeries ${PB24} PTS DAC20 )
# spcm linux driver needs to be installed (see http://spectrum-instrumentation.com/de/downloads/drivers) # spcm linux driver needs to be installed (see http://spectrum-instrumentation.com/de/downloads/drivers)
#include_directories(${CMAKE_SOURCE_DIR}/drivers/Spectrum-M2i40xxSeries/include) include_directories(${CMAKE_SOURCE_DIR}/drivers/Spectrum-M2i40xxSeries/include)
#add_executable(fc1_vierkanal_backend fc1_vierkanal_backend.cpp hardware.cpp) add_executable(fc1_vierkanal_backend fc1_vierkanal_backend.cpp hardware.cpp)
#target_link_libraries( fc1_vierkanal_backend pthread ${XERCES_LIBRARIES} core spcm_linux Spectrum-M2i40xxSeries ${PB24} PTS DAC20 ) target_link_libraries( fc1_vierkanal_backend pthread ${XERCES_LIBRARIES} core spcm_linux Spectrum-M2i40xxSeries ${PB24} PTS DAC20 )
# spcm linux driver needs to be installed (see http://spectrum-instrumentation.com/de/downloads/drivers)
include_directories(${CMAKE_SOURCE_DIR}/drivers/Spectrum-M2i40xxSeries/include)
add_executable(fc1_backend fc1_backend.cpp hardware.cpp)
target_link_libraries( fc1_backend pthread ${XERCES_LIBRARIES} core spcm_linux Spectrum-M2i40xxSeries ${PB24} PTS DAC20 )
add_executable(fc2_backend fc2_backend.cpp hardware.cpp) add_executable(fc2_backend fc2_backend.cpp hardware.cpp)
target_link_libraries( fc2_backend pthread ${XERCES_LIBRARIES} core Spectrum_MI40xxSeries ${PB24} PTS DAC20 ) target_link_libraries( fc2_backend pthread ${XERCES_LIBRARIES} core Spectrum_MI40xxSeries ${PB24} PTS DAC20 )

View File

@ -40,9 +40,11 @@ public:
FC1_hardware() { FC1_hardware() {
ttlout trigger; ttlout trigger;
trigger.id=0; trigger.id=0;
trigger.ttls=0x400000; /* line 22 */// //trigger.ttls=0x400000; /* line 22 *///
trigger.ttls=1<<22; /* line 22 *///
my_adc=new SpectrumM2i40xxSeries(trigger); my_adc=new SpectrumM2i40xxSeries(trigger);
my_pulseblaster=new SpinCorePulseBlaster24Bit(0,1e8,0x800000); //my_pulseblaster=new SpinCorePulseBlaster24Bit(0,1e8,0x800000);
my_pulseblaster=new SpinCorePulseBlaster24Bit(0,1e8,0);//,0x000000);
PTS* my_pts=new PTS_latched(0); // ID of PTS_analogout 0 PTS* my_pts=new PTS_latched(0); // ID of PTS_analogout 0
the_fg=my_pts; the_fg=my_pts;
the_pg=my_pulseblaster; the_pg=my_pulseblaster;
@ -66,9 +68,9 @@ public:
list_dacs.push_back(dac); list_dacs.push_back(dac);
} }
/* virtual */ void experiment_run_pulse_program(state* work_copy) { // /* virtual */ void experiment_run_pulse_program(state* work_copy) {
//my_pulseblaster->run_pulse_program_w_sync(*work_copy, my_adc->get_sample_clock_frequency()); //my_pulseblaster->run_pulse_program_w_sync(*work_copy, my_adc->get_sample_clock_frequency());
} // }
virtual ~FC1_hardware() { virtual ~FC1_hardware() {
if (the_adc!=NULL) delete the_adc; if (the_adc!=NULL) delete the_adc;