[Skyeye-developer] help simulating at91 timer
josh jordan
josh.outerspace at gmail.com
Fri Jul 20 20:55:10 CST 2007
Thank you for your reply. I was able to apply the patch and recompile
the binary. Skyeye will run with 'SIGHUP's, it will still step thru
instructions. I am still not seeing any effect of writing to IO
space. Here is the code I am trying to simulate and my skyeye.conf
file. Please let me know if you see an error in the following test
code. Best regards, Josh Jordan.
int main (void) {
signed char i, j;
long result = 0;
volatile long output;
unsigned int finalcount;
signed char coeff[9]; // variable to test library function
// Initialize the Atmel AT91SAM7S256 (watchdog, PLL clock, default
interrupts, etc.)
LowLevelInit(); //step out of functions that wait on io bits to change
// enable the Timer0 peripheral clock
volatile AT91PS_PMC pPMC = AT91C_BASE_PMC;
volatile AT91PS_TC pTC = AT91C_BASE_TC0;
pPMC->PMC_PCER = (1<<AT91C_ID_TC0); // enable Timer0 peripheral clock
pTC->TC_CCR = 0x0005; // enable the clock and start it
pTC->TC_CMR = 0x4000; //enable waveform mode
//enableIRQ();
//enableFIQ();
for (i = 0; i <= 8; i++){
coeff[i] = i-4; //manual init puts vars in sram instead of flash.
}
for (i = 0; i < 100; i++){
for (j = 8; j > 0; j--){
result += coeff[j]*i;
}
output = result;
}
finalcount = pTC->TC_CV;
while (1) {}
}
cpu: arm7tdmi
mach: at91
mem_bank: map=M, type=RW, addr=0x00000000, size=0x00010000
mem_bank: map=M, type=RW, addr=0x00200000, size=0x00004000
mem_bank: map=I, type=RW, addr=0xf0000000, size=0x10000000
net: type=rtl8019, mac=0:4:3:2:1:f, ethmod=tuntap, hostip=10.0.0.1
log: logon=0, logfile=/tmp/sk1.log, start=100000, end=200000
On 7/18/07, Michael. Kang <blackfin.kang at gmail.com> wrote:
> In the original implementation of at91 simulation, only
> timer1 is simulated. I had done a patch against skyeye_1_2_3_Rel to
> implement three timer channel.Maybe useful for your case.
> Run "patch -p0 < skyeye_mach_at91-timer.diff" under skyeye
> source dir to apply my patch in the attachment.
>
> -- Thanks
> -- Michael.Kang
> On 7/17/07, josh jordan <josh.outerspace at gmail.com> wrote:
> > I am trying to get timer0 to work to count cycles in simulation. Here
> > is some debug output:
> >
> > p/x pTC0
> > $1 = 0xfffa0000
> > p/x *pTC0
> > $2 = {TC_CCR = 0x21, TC_CMR = 0x80000000, Reserved0 = {0x0, 0x0},
> > TC_CV = 0x0, TC_RA = 0x0, TC_RB = 0x0, TC_RC = 0x0, TC_SR = 0x0,
> > TC_IER = 0x0, TC_IDR = 0x0, TC_IMR = 0x0}
> >
> > it recognizes the pTC0 pointer with the correct address. It decodes
> > the struct. But the values of the struct are stuck. My program
> > assigns other values to them but they always read as above. Even when
> > I try to change it like pTC0->TC_CCR=1 that has no effect either.
> > pTC0->TC_CV always reads zero!
> >
> > It looks like the source code updates timers, I am just not using it correctly.
> >
> > Here is my conf file, trimmed down most everything commented.
> >
> > cpu: arm7tdmi
> >
> > # machine(develop board) maybe at91 or ep7312
> > mach: at91
> >
> > mem_bank: map=M, type=RW, addr=0x00000000, size=0x00010000
> > mem_bank: map=M, type=RW, addr=0x00200000, size=0x00004000
> > mem_bank: map=I, type=RW, addr=0xf0000000, size=0x10000000
> >
> > net: type=rtl8019, mac=0:4:3:2:1:f, ethmod=tuntap, hostip=10.0.0.1
> >
> > log: logon=0, logfile=/tmp/sk1.log, start=100000, end=200000
> >
> > _______________________________________________
> > Skyeye-developer mailing list
> > Skyeye-developer at lists.gro.clinux.org
> > http://lists.gro.clinux.org/cgi-bin/mailman/listinfo/skyeye-developer
> >
> >
>
>
> --
> www.skyeye.org
>
> _______________________________________________
> Skyeye-developer mailing list
> Skyeye-developer at lists.gro.clinux.org
> http://lists.gro.clinux.org/cgi-bin/mailman/listinfo/skyeye-developer
>
>
>
More information about the Skyeye-developer
mailing list