Advertisement
platinum95

Untitled

Apr 17th, 2019
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.22 KB | None | 0 0
  1. Kind of like a mix of Verilog, C, and PHDL.
  2.  
  3. primitives:
  4. - All the C-primitives for non-synthesised stuff
  5.  
  6. - resistor( ohms );
  7. - capacitor( uF );
  8. - diode();
  9. - Other primitives I've forgotten
  10.  
  11. New components can be specified through module definitions.
  12. Can have some standard-library of common components that aren't primitives like
  13. triacs, transistors, LEDs and so forth.
  14.  
  15. Source files are headers (defining module interfaces) and module-files defining
  16. the module itself.
  17. Each source can be synthesised down to a netlist and doesn't need to be
  18. re-synthesised unless its source changes, like C.
  19.  
  20.  
  21. These really just define the interface between components, without proper
  22. specification of electrical properties (other than for resister/capacitor), but
  23. there's nothing stopping you from defining more in custom modules with C-type
  24. primitives.
  25. General idea is to have the type-based constraints done separately, which will
  26. basically just give more specification to the components in a design.
  27.  
  28. Footprint of types not considered until .brd (or similar) generation. Again can
  29. have some spec/constraint files for this.
  30.  
  31.  
  32. Sample Hello RC module defining a basic hipass filter:
  33.  
  34. ```
  35. // helloRC.h
  36. template< int freq >
  37. module HelloRC
  38. interface( net inSignal, net outSignal, net gnd );
  39. public:
  40. <some public components>
  41. private:
  42. <some private components>
  43. endmodule
  44. ```
  45.  
  46.  
  47. ```
  48. // helloRC.pl
  49. // Simple RC hipass filter
  50. template< int freq >
  51. module HelloRC( net inSignal, net outSignal, net gnd )
  52.  
  53. // C-like primitives not synthesised but used to generate module instance
  54. int rVal = 1000; //ohm
  55. int cVal = 1.0/( 2 * 3.14 * rVal * freq ) * 1e6; // (uF)
  56.  
  57. resistor r1( rVal );
  58. capacitor c1( cVal );
  59.  
  60. // "anonymous" net
  61. c1.a = inSignal;
  62.  
  63. // Named net
  64. net sampleNet;
  65.  
  66. c1.b = sampleNet;
  67. r1.a = sampleNet;
  68.  
  69. r1.b = gnd;
  70. endmodule
  71. ```
  72.  
  73. This module can then be used in other modules like so:
  74. ```
  75. #include <helloRC.h>
  76.  
  77. module filterBank( net inSignal, net outSignal, net gnd )
  78. net f1Out, f2Out;
  79. HelloRC f1( inSignal, f1Out, gnd );
  80. HelloRC f2( f1Out, f2Out, gnd );
  81. HelloRC f3( f2Out, outSignal, gnd );
  82. endmodule
  83. ```
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement