Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PWMBase module is instanced in .fir file but not exisiting in final rtl codes ? why #15

Closed
etchen66 opened this issue Aug 8, 2017 · 3 comments

Comments

@etchen66
Copy link

etchen66 commented Aug 8, 2017

module PWMTL_pwm :
input clock : Clock
input reset : UInt<1>
output io : {interrupts : {}, flip in : {0 : {a : {flip ready : UInt<1>, valid : UInt<1>, bits : {opcode : UInt<3>, param : UInt<3>, size : UInt<2>, source : UInt<7>, address : UInt<14>, mask : UInt<4>, data : UInt<32>}}, flip b : {flip ready : UInt<1>, valid : UInt<1>, bits : {opcode : UInt<3>, param : UInt<2>, size : UInt<2>, source : UInt<7>, address : UInt<14>, mask : UInt<4>, data : UInt<32>}}, c : {flip ready : UInt<1>, valid : UInt<1>, bits : {opcode : UInt<3>, param : UInt<3>, size : UInt<2>, source : UInt<7>, address : UInt<14>, data : UInt<32>, error : UInt<1>}}, flip d : {flip ready : UInt<1>, valid : UInt<1>, bits : {opcode : UInt<3>, param : UInt<2>, size : UInt<2>, source : UInt<7>, sink : UInt<1>, addr_lo : UInt<2>, data : UInt<32>, error : UInt<1>}}, e : {flip ready : UInt<1>, valid : UInt<1>, bits : {sink : UInt<1>}}}}, pwmout : UInt<1>}

clock is invalid
reset is invalid
io is invalid
reg period : UInt<32>, clock @[PWM.scala 49:19]
reg duty : UInt<32>, clock @[PWM.scala 51:17]
reg enable : UInt<1>, clock with : (reset => (reset, UInt<1>("h00"))) @[PWM.scala 53:23]
inst base of PWMBase @[PWM.scala 55:20]  

// comments : in lines above , PWMbase shall be instanced. however, at the end , PWMBase module is totally removed, I don't know why , I just follow the instruction steps make PROJECT=example Confing= PWMConfig, nothing else. The result is PWMBase disappear

Any one who have same situations that could share ?

io.pwmout <= base.io.pwmout @[PWM.scala 56:13]
@etchen66
Copy link
Author

etchen66 commented Aug 12, 2017

I debugged for a whole day.
I noticed if pwmout is not pulled out to TestHarness, then firrtl will optimize the rtl codes , which leads PWMBase is totally removed.
I manually update the .fir file and pull the pwmout put to TestHarness to make it work. Every module including PWMBase is present.

Now, I have a question, how to do it formally to pull out pwmout in chisel/scala level ?
Here is what I do.

class TestHarness(implicit val p: Parameters) extends Module {
val io = IO(new Bundle {
val success = Output(Bool())
val pwmout = Output(Bool()) -> 1. add a new port
})

val dut = p(BuildTop)(p)
dut.connectSimAXIMem()
io.success := dut.connectSimSerial()
io.pwmout := dut.pwmout -> 2. connect them, it reports error during make CONFIG=PWMConfig

Please help ........

Thanks,
Steven

@colinschmidt
Copy link
Contributor

@jackkoenig would know more about why firrtl is optimizing away the PWM.

For the error you are encountering now it would be helpful to see the output, what you've done seems reasonable if pwmout is a Bool

@zhemao
Copy link
Contributor

zhemao commented Feb 24, 2018

The problem was that the DontTouch annotations weren't being passed to the FIRRTL compiler. I've fixed those in 073c169.

@zhemao zhemao closed this as completed Feb 24, 2018
albert-magyar pushed a commit that referenced this issue Jul 18, 2019
* modified CustomBundle to also apply on Int

* programmatic bundle should take T <: Data instead of Data

* turns out indexedElements doesn't synthesize

* had to change a bunch of files to get clk/pads compiling again with recent firrtl mods
@ksungkeun84 ksungkeun84 mentioned this issue Feb 6, 2024
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants