Ejemplo n.º 1
0
        public const int TOTAL_COG_MEMORY = 0x200;  // 512 longs of memory

        /// @brief Default constructor.
        public Cog(PropellerCPU host, uint programAddress, uint param, uint frequency, PLLGroup pll)
        {
            Hub = host;

            Memory         = new uint[TOTAL_COG_MEMORY];
            ProgramAddress = programAddress;
            ParamAddress   = param;

            FreqA           = new FreqGenerator(host, pll, true);
            FreqB           = new FreqGenerator(host, pll, false);
            Video           = new VideoGenerator(host);
            PhaseLockedLoop = pll;

            // Attach the video generator to PLLs
            PhaseLockedLoop.SetupPLL(Video);

            PC = 0;
            BreakPointCogCursor = -1;    // Breakpoint disabled initially

            // We are in boot time load
            Memory[(int)Assembly.RegisterAddress.PAR] = param;
            State      = CogRunState.WAIT_LOAD_PROGRAM;
            StateCount = 0;

            // Clear the special purpose registers
            for (int i = (int)Assembly.RegisterAddress.CNT; i <= 0x1FF; i++)
            {
                this[i] = 0;
            }

            SetClock(frequency);
        }
Ejemplo n.º 2
0
 public void RemoveHook(VideoGenerator vgn)
 {
     if (AuralHooks.Contains(vgn))
     {
         AuralHooks.Remove(vgn);
     }
     return;
 }
Ejemplo n.º 3
0
 public void AttachHook(VideoGenerator vgn)
 {
     if (!AuralHooks.Contains(vgn))
     {
         AuralHooks.Add(vgn);
     }
     return;
 }
Ejemplo n.º 4
0
 public void Destroy()
 {
     Partner = null;
     AuralHooks.Clear();
 }
Ejemplo n.º 5
0
        public void SetupPLL(VideoGenerator partner)
        {
            Partner = partner;

            AuralHooks.Clear();
        }