Posted to tcl by zashi at Fri Sep 06 12:03:27 GMT 2019view raw
- so, I'm designing a DSL in which you can model specific hardware in a more descriptive way, sort of how QML or html is.. So you define devices with signals as inputs and signal as outputs and every device has sub-devices.. In the end the final result is that you can see the power and clocks and other signals for each part of a microprocessor while describing it in a logical way. I've tested it and it works, although I have figured it out that I cannot read some SFR if there is no power to that part of the chip.. Now, a output signal is always an expr of the input signals and so a signal is described sort of like signal in NAME bind {$signal2 & $signal3} and signal2 and signal3 has traces on them so they read some other signals in a sort of recursive (but not quite) way. Now, a signal should always be able to abort the whole reading by the way of an custom exception and so the first read of the signal would catch the abort exception
- here's how the abort test looks like:
- model mdl {
- component device {}
- device shv {
- signal provide abort bind { [error "ABORT" {} SIGNAL_ABORT] }
- device dev {
- signal use ../abort as r
- signal provide cannotRead bind {$r}
- device dev {
- signal use ../cannotRead as r
- signal provide cannotRead bind {$r}
- device dev {
- signal use ../cannotRead as r
- signal provide cannotRead bind {$r}
- device dev {
- signal use ../cannotRead as r
- signal provide cannotRead bind {$r}
- }
- }
- }
- }
- }
- }
- puts "\n\nHierarchy:"
- $mdl all {
- puts " [format "%s %-20s" [self] [my path]]"
- }
- puts ">>>>>> [$mdl find shv/abort read]"
- puts ">>>>>> [$mdl find shv/dev/cannotRead read]"
- puts ">>>>>> [$mdl find shv/dev/dev/cannotRead read]"
- puts ">>>>>> [$mdl find shv/dev/dev/dev/cannotRead read]"
- puts ">>>>>> [$mdl find shv/dev/dev/dev/dev/cannotRead read]"