Presentation is loading. Please wait.

Presentation is loading. Please wait.

Jason O. Trinidad-Pérez Department of Electrical and Computer Engineering Inter American University of Puerto Rico Mentors: Yuriy Pischalnikov and Warren.

Similar presentations


Presentation on theme: "Jason O. Trinidad-Pérez Department of Electrical and Computer Engineering Inter American University of Puerto Rico Mentors: Yuriy Pischalnikov and Warren."— Presentation transcript:

1 Jason O. Trinidad-Pérez Department of Electrical and Computer Engineering Inter American University of Puerto Rico Mentors: Yuriy Pischalnikov and Warren Schappert

2  Objectives  Introduction  Hardware  Firmware  Software  Testing  Conclusion  References

3  To configure the FPGA for RF cavity simulation.  Create an interface for the FPGA.

4  Fermilab uses RF cavities to accelerate particle beams.  To test electronics that control these cavities, simulators are useful.  An FPGA can be used as a simulator.

5  XtremeDSP Development Kit-IV: ◦ BenONE-Kit Motherboard  Spartan-II FPGA for PCI or USB interface.  Host interface via PCI or USB.  Status LEDs. ◦ BenADDA DIME-II module:  Virtex-4 user FPGA.  2 independent 14-bits ADCs and DACs.  On board oscillator, support for external clock and programmable clocks.

6

7  Firmware was written in VHDL. ◦ 3 Registers where assigned:  14-bits address register.  32-bits input register.  32-bits output register. ◦ ADC input  Passes ADC input signal into the FPGA. ◦ DAC output  Passes processed signal to the DAC.

8  Started with working examples. ◦ ADC to DAC hookup. ◦ Host Interface.  Merged both examples and…

9  Lots of errors!!!

10

11  Can’t copy and paste. ◦ Assign pins. ◦ Set clocks. ◦ Other files.

12  Implemented difference equations. ◦ Used for simulating many physical systems. ◦ RCL continuous 2 nd order differential equation: ◦ Discrete difference equation:

13  Difference equation in VHDL ◦ 32-bits variables ◦ t1 <= (a11*x0) + (a12*x1) + (b1*u0); ◦ t2 <= (a21*x0) + (a22*x1) + (b2*u0); ◦ t3 <= (c1*x0) + (c2*x1); ◦ x0 <= t1(63) & t1(61 downto 32); ◦ x1 <= t1(63) & t2(61 downto 32); ◦ y0 <= t1(63) & t3(61 downto 32);

14  Address register ◦ Address register used to specify the variable to be written or read: Address registerVariable 1a 11 2a 12 3a 21 4a 22 5b0b0 6b1b1 7c0c0 8c1c1

15  DIMEScript ◦ Interpreted language. ◦ Errors only found when line with error is executed. ◦ Needs FUSE environment, DIMEcontrol application or user application to run script.

16  C API ◦ Easier for verifying errors. ◦ Better I/O. ◦ More control over variables.

17  MATLAB ◦ C codes as MATLAB functions using MEX-files. ◦ Better interface. ◦ Even more control over variables.

18  4 MATLAB functions ◦ Open card  x = opencard ◦ Close card  closecard(x(1), x(2)) ◦ Write register  writereg(x(2),address,number) ◦ Read register  y = readreg(x(2),address)

19  Assigned values to the variables: ◦ a = 0 ◦ b = c =2 32 -1 ◦ t1 <= (a11*x0) + (a12*x1) + (b1*u0); ◦ t2 <= (a21*x0) + (a22*x1) + (b2*u0); ◦ t3 <= (c1*x0) + (c2*x1); ◦ x0 <= t1(63) & t1(61 downto 32); ◦ x1 <= t1(63) & t2(61 downto 32); ◦ y0 <= t1(63) & t3(61 downto 32);

20  Nothing was supposed to happen to the input Input Output

21  DAC1_D <= not(not yo(31) & y0(30 downto 18)) Input Output

22  Implement a rotation matrix to simulate an RF cavity.

23 theta= 2*pi/10 lambda =.85 fullscale = 2^31-1 a11= uint32((fullscale)*(lambda)*(cos(theta))) a12= uint32((fullscale)*(lambda)*(sin(theta))) a21= uint32(mod(double(2^32)-double(a12),2^32)); a22= a11; b0 = fullscale*(1-lambda) b1 = 0 c0 = fullscale c1 = 0

24  As λ nears 1, sine wave should take more time to decay completely. λ=0.85 λ=0.86

25 λ=0.863 λ=0.865

26 λ ≥ 0.865

27  The core part of the simulator was successfully configured. ◦ Other components need to be added.  An interface was created in MATLAB to facilitate communication with the board.

28  Fermilab ◦ Mentors: Warren Schappert and Yuriy Pischalnikov ◦ David Peterson ◦ Carol Angarola ◦ Technical Department staff ◦ Cafeteria employees  PR-LSAMP

29  DIMEScript User Guide. Issue 3. 22/02/2005 Nallatech Limited.  FUSE C/C++ API Overview. Issue 8. 17/01/2005 Nallatech Limited.  XtremeDSP Development Kit-IV User Guide. Issue 1. 01/04/2005 Nallatech Limited.  MEX-files Guide. http://www.mathworks.com/support/tech- notes/1600/1605.html#intro  C++ with Matlab Tutorial. Oct 16 2007. http://www.icaen.uiowa.edu/~dip/lecture/C++_with_Matlab.pdf  MEX-File Programming for Image Processing Using DIPimage May, 11 2007. Luengo, C. L. ftp://ftp.qi.tnw.tudelft.nl/pub/DIPlib/Download/docs/mex_file_prog ramming.pdf

30


Download ppt "Jason O. Trinidad-Pérez Department of Electrical and Computer Engineering Inter American University of Puerto Rico Mentors: Yuriy Pischalnikov and Warren."

Similar presentations


Ads by Google