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)CogSpecialAddress.PAR] = param; State = CogRunState.WAIT_LOAD_PROGRAM; StateCount = 0; // Clear the special purpose registers for (int i = (int)CogSpecialAddress.CNT; i <= 0x1FF; i++) { this[i] = 0; } SetClock(frequency); }
/// @brief Default constructor for a Cog running in PASM mode. /// @param host PropellerCPU where this cog resides. /// @param programAddress Start of program to load from main memory. /// @param paramAddress PARAM value given to the Cog. /// @param frequency Frequency running the cog (the same as the Propeller). /// @param pll PLL Multiplier running the cog (the same as the Propeller). public NativeCog(PropellerCPU host, uint programAddress, uint paramAddress, uint frequency, PLLGroup pll) : base(host, programAddress, paramAddress, frequency, pll) { Carry = false; Zero = false; }
public FreqGenerator(PropellerCPU host, PLLGroup phaseLockLoop, bool freqA) { Host = host; OutA = false; OutB = false; FreqA = freqA; PhaseLockLoop = phaseLockLoop; }