Beispiel #1
0
 public void Initialize()
 {
     m_BankService = new MemoryBankService(new List <IMemoryBank>()
     {
         new MemoryBank(32)
     });
     m_Reader = new OperationReader(ArchitectureFactory.CreateArchitecture(m_BankService), _CreateReader());
 }
Beispiel #2
0
 public OperationFetcher(IOperationReader Reader,
                         IMemoryBankService BankService,
                         IMemoryLocationAddressReader LocationReader)
 {
     m_Reader         = Reader;
     m_BankService    = BankService;
     m_LocationReader = LocationReader;
 }
Beispiel #3
0
 public void Initialize()
 {
     m_BankService = new MemoryBankService(new List <IMemoryBank>()
     {
         _CreateMemoryBank()
     });
     m_Fetcher = new OperationFetcher(_CreateReader(), m_BankService, new MemoryLocationAddressReader());
 }
Beispiel #4
0
 public Machine(
     ICPU CPU,
     IOscillator MachineOscillator,
     IMemoryBankService BankService)
 {
     m_Oscillator  = MachineOscillator;
     m_CPU         = CPU;
     m_BankService = BankService;
 }
Beispiel #5
0
 public void Initialize()
 {
     m_Oscillator  = new Clock();
     m_CPU         = new CPU();
     m_Bank        = new MemoryBank(512);
     m_BankService = new MemoryBankService(new List <IMemoryBank>
     {
         m_Bank
     });
     m_Machine = new Machine(m_CPU, m_Oscillator, m_BankService);
 }
Beispiel #6
0
 private static Dictionary <int, IOperationConverter> _CreateConverters(IMemoryBankService BankService)
 {
     return(new Dictionary <int, IOperationConverter>
     {
         { 0, new NoOpConverter() },
         { 1, new OpAddConverter(BankService) },
         { 5, new OpSubConverter(BankService) },
         { 10, new OpLoadConstConverter(BankService) },
         { 11, new OpLoadConverter(BankService) }
     });
 }
Beispiel #7
0
 public static IArchitecture CreateArchitecture(IMemoryBankService BankService)
 {
     return(new Architecture
            (
                "TestArchitecture",
                new Dictionary <int, IOperationConverter>
     {
         { 0, new NoOpConverter() },
         { 1, new OpLoadConstConverter(BankService) },
         { 2, new OpLoadConverter(BankService) }
     },
                new List <OperationDefinition>
     {
         new OperationDefinition(0, 0),
         new OperationDefinition(1, 4 * 3),
         new OperationDefinition(2, 4 * 4)
     }
            ));
 }
Beispiel #8
0
        public void Initialize()
        {
            m_Arch = _CreateArchitecture();

            m_CPU         = new CPU();
            m_Oscillator  = new Clock();
            m_Bank        = new MemoryBank(512);
            m_BankService = new MemoryBankService(new List <IMemoryBank>()
            {
                m_Bank
            });
            m_AddressReader = new MemoryLocationAddressReader();
            m_OpDtoReader   = new OperationDTOReader(m_Arch);
            m_OpReader      = new OperationReader(m_Arch, m_OpDtoReader);

            m_Fetcher     = new OperationFetcher(m_OpReader, m_BankService, m_AddressReader);
            m_OpFeeder    = new OperationFeeder(m_Fetcher);
            m_CPUConsumer = new CPUConsumer(m_CPU);

            SetupComponents();
        }
Beispiel #9
0
 public OpAddConverter(IMemoryBankService BankService)
 {
     m_BankService = BankService;
 }
Beispiel #10
0
 private IOperationFetcher _CreateFetcher(IMemoryBankService BankService)
 {
     return(new OperationFetcher(_CreateReader(), BankService, new MemoryLocationAddressReader()));
 }
Beispiel #11
0
 public void Initialize()
 {
     m_Service = new MemoryBankService(new List <IMemoryBank> {
         new MemoryBank(32)
     });
 }
Beispiel #12
0
 public vCPUArchitecture(IMemoryBankService BankService)
     : base("vCPU", _CreateConverters(BankService), _CreateDefinitions())
 {
 }
Beispiel #13
0
 public OpLoadConstConverter(IMemoryBankService Service)
 {
     m_BankService = Service;
 }