- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I am trying to create a component with a variable width, similar to the 'Basic Counter' in the Utility subfolder of the Cypress library. This component allows one to change the counter width by changing the 'Widch' parameter of the component instance. When this parameter value is changed the corresponding counter ouput bus on the schematic symbol is updated to reflect the new bus size.
How can I implement this functionality on a symbol that I create? I tried using the following steps.
1. Add Component Item using Symbol Wizard
2. Create a symbol named 'Foo' and add an input terminal named 'clock' and an output terminal named 'count'
3. Right-click on blank part of symbol Foo sheet, then select 'Symbol Parameters...'
4. Add parameter 'Size' of type int and set value to 4. Close Parameters Definition dialog.
5. Double-click 'count' terminal to edit.
6. This is where I want to set the range of the 'count' symbol terminal to be 'Size-1:0'. However, I have no way to use an expression to set either the left or right index.
The Warp verilog reference gives the following example. I tried to generate a symbol from the following code but was not successful.
Does anyone know how to create symbols with terminals who's width changes with a parameter value???
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Its modified in the customizer file "custom.cs". You can import the component from the Basic Counter compoennt library and check the implementaion.
Or if you just want to switch b/w 2/3 known widths you can check the status register implemetation.
-Keerthi
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content