You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have 3 questions about PWMTL. I'm new to this project so the questions may looks amateure but I really need your help. Thanks!
After cd verisim make PROJECT=pwm CONFIG=PWMTLConfig
I saw pwm { addr 0x2000; size 0x1000; }
on the screen.
But when I look in PWM.scala,Top.scala,TestHarness.scala,Configs.scala, I couldn't find out how to change these parameters. So what should I do if I want to change them?
Besides, in pwm.c, it define 3 registers #define PWM_PERIOD 0x2000 #define PWM_DUTY 0x2008 #define PWM_ENABLE 0x2010
According to PWM.scala, the reg address can be distinguish by the lower 2bits of full_addr, but I'm still not sure what does the full_addr look like.Because the 3 regs are all end with 00, so how can we distinguish them by the lower 2bits?Or in another words, why the address of Reg PWM_DUTY is 0x2008?If I change it to 0x2018 and write something into this address, what should I do to make sure PWM find the right address and update the the register?
Last question, can we make sure the PWM is working well? In pwm.c we only write some data in the regs and enable the PWM, but I don't know if the module really works.
The text was updated successfully, but these errors were encountered:
If you change MemSize(4096, ... to MemRange(startAddr, 4096, ... it will move the base address to startAddr.
The full_addr is a (64-bit) word address and not a byte address. So byte addresses 00, 08, and 10 correspond to word addresses 0, 1, and 2, respectively. We use the lower two bits of this address because there are only 3 registers.
I have 3 questions about PWMTL. I'm new to this project so the questions may looks amateure but I really need your help. Thanks!
After
cd verisim
make PROJECT=pwm CONFIG=PWMTLConfig
I saw
pwm {
addr 0x2000;
size 0x1000;
}
on the screen.
But when I look in PWM.scala,Top.scala,TestHarness.scala,Configs.scala, I couldn't find out how to change these parameters. So what should I do if I want to change them?
Besides, in pwm.c, it define 3 registers
#define PWM_PERIOD 0x2000
#define PWM_DUTY 0x2008
#define PWM_ENABLE 0x2010
According to PWM.scala, the reg address can be distinguish by the lower 2bits of full_addr, but I'm still not sure what does the full_addr look like.Because the 3 regs are all end with 00, so how can we distinguish them by the lower 2bits?Or in another words, why the address of Reg PWM_DUTY is 0x2008?If I change it to 0x2018 and write something into this address, what should I do to make sure PWM find the right address and update the the register?
Last question, can we make sure the PWM is working well? In pwm.c we only write some data in the regs and enable the PWM, but I don't know if the module really works.
The text was updated successfully, but these errors were encountered: