| The driver is an important part of the arbitrary waveform generator,which lies between the HMI and the hardware board,and can control the hardware board to realize the waveform synthesis function.The complexity of arbitrary waveform generator functions and the variety of solutions make the driver highly complex.Driver developers need to develop a separate driver for each arbitrary waveform generator,which can cause a lot of work.For the above situation,a lot of work can be reduced if the driver is automatically generated,and the basis of automatic driver generation is the design of the driver framework,which provides strong support for the automatic driver generation.In this paper,the following research is done for the design of driver framework.1.To address the contradiction between writing drivers efficiently and the complexity of arbitrary waveform generator hardware,a hierarchical idea is adopted to design the framework structure.By analyzing common arbitrary waveform generator hardware design solutions and common human-machine interaction interfaces,the framework structure is divided into a core layer,a use case layer,and an interface layer.The core layer includes registers,memories,DACs,FIFOs and relays;the use case layer includes clock modules,trigger modules,waveform synthesis modules and signal conditioning modules;the interface layer includes clock configuration,trigger configuration and channel configuration interfaces.2.To address the contradiction between the reusability of the driver framework and the diversity of arbitrary waveform generator hardware design solutions,we adopt the idea of dependency injection to design the framework mechanism,extract the common control flow in the driver,and design the related interfaces.For different functional implementations,the framework users can inject the functional implementation logic into the corresponding modules within the framework,so that the specific logic outside the framework is combined with the unchanging control flow within the framework,thus forming a set of drivers for specific projects.3.For two arbitrary waveform generators,the respective drivers were designed and implemented based on the framework.Tests on the corresponding hardware show that these drivers function properly.This paper compares the framework-based and standalone drivers in terms of lines of source code and shows that the total code size of the framework-based drivers is reduced by an average of 72%. |