Posted to tcl by zashi at Fri Sep 06 12:03:27 GMT 2019view raw

  1. 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
  2.  
  3. here's how the abort test looks like:
  4.  
  5. model mdl {
  6. component device {}
  7.  
  8. device shv {
  9. signal provide abort bind { [error "ABORT" {} SIGNAL_ABORT] }
  10. device dev {
  11. signal use ../abort as r
  12. signal provide cannotRead bind {$r}
  13. device dev {
  14. signal use ../cannotRead as r
  15. signal provide cannotRead bind {$r}
  16. device dev {
  17. signal use ../cannotRead as r
  18. signal provide cannotRead bind {$r}
  19. device dev {
  20. signal use ../cannotRead as r
  21. signal provide cannotRead bind {$r}
  22. }
  23. }
  24. }
  25. }
  26. }
  27. }
  28.  
  29. puts "\n\nHierarchy:"
  30. $mdl all {
  31. puts " [format "%s %-20s" [self] [my path]]"
  32. }
  33.  
  34. puts ">>>>>> [$mdl find shv/abort read]"
  35. puts ">>>>>> [$mdl find shv/dev/cannotRead read]"
  36. puts ">>>>>> [$mdl find shv/dev/dev/cannotRead read]"
  37. puts ">>>>>> [$mdl find shv/dev/dev/dev/cannotRead read]"
  38. puts ">>>>>> [$mdl find shv/dev/dev/dev/dev/cannotRead read]"
  39.