Cat
CU_v1.cpp
Go to the documentation of this file.
1 // $Id: $
2 // Include files
3 
4 
5 // local
6 #include "CU_v1.h"
7 #include "FePGA.h"
8 //-----------------------------------------------------------------------------
9 // Implementation file for class : CU_v1
10 //
11 // 2006-10-23 :
12 //-----------------------------------------------------------------------------
13 
14 //=============================================================================
15 // Standard constructor, initializes variables
16 //=============================================================================
18  setName("CU_v1");
19  setType("CU_v1");
21 
22  m_fifoDepth = 1024;
23 
24  //m_seqAddress = 17 ; // c'est l'addresse du FPGA
25  //m_fifoInjectAddress[0] = 23; // What should I do here?
26 
27  m_fePga =new FePGA();
28  m_fePga->setName("FePGA");
30 
31  /*
32 
33  m_fifo[0] = new unsigned int[m_fifoDepth];
34 
35  for (int i = 0; i<3; ++i){ // Do I loop up to 3 too? Car Frederic a besoin de plus de place dans les RAM
36  m_ramInj[i] = new RAM();
37  // m_ramSpy[i] = new RAM();
38  fePga()->usb()->addChild(m_ramInj[i]); // What should I do here ?
39  // FePga()->usb()->addChild(m_ramSpy[i]);
40  m_ramInj[i]->setAddress(13); // for debug // What should I do here ?
41  //m_ramSpy[i]->setAddress(m_fifoSpyAddress[i]);
42  m_ramInj[i]->setSize(16, m_fifoDepth); // What should I do here ?
43  // m_ramSpy[i]->setSize(16, m_fifoDepth);
44  }
45 
46 
47 
48 
49  m_fifoUsbTest = new RAM();
50  m_fifoUsbTest->setAddress(3); // WARNING I NEED TO CHANGE THE ADDRESS
51  m_fifoUsbTest->setSize(16,256); // WHAT SIZE FOR I NNED
52  m_fifoUsbTest->setName("FifoUsbTest");
53  fePga()->usb()->addChild(m_fifoUsbTest);
54 */
55 
56 }
57 //=============================================================================
58 // Destructor
59 //=============================================================================
61 }
62 // Question which write Fifo should I write ?
63 //=============================================================================
64 void CU_v1::readFifo( int add, int subadd, unsigned int *fifo){
65 m_fePga->spiRead(subadd, m_fifoDepth, fifo); // Question why do we read the fifo with spi? /
66 }
67 //=============================================================================
void add(int attribut)
Definition: Attrib.h:67
virtual ~CU_v1()
Destructor.
Definition: CU_v1.cpp:60
void setName(std::string name)
Definition: Object.h:51
int m_fifoDepth
Definition: CU_v1.h:65
Definition: FePGA.h:23
FePGA * m_fePga
Definition: CU_v1.h:68
void setType(std::string type)
Definition: Object.h:52
CU_v1()
Standard constructor.
Definition: CU_v1.cpp:17
void readFifo(int, int, unsigned int *)
Definition: CU_v1.cpp:64
StatusCode spiRead(unsigned int, unsigned int, unsigned int *)
Definition: FePGA.cpp:102
virtual void addChild(Hierarchy *element)
Definition: Hierarchy.cpp:83