- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Hi guys, I think this is my first post and I am glad to belong to ALTERA forums.

Here is my problem: I've read some posts from other forums and I cannot find anything related to invoke a function from a function in VHDL. Is that possible???? Here is the thing, I created a ROM of 168 positions of std_logic_vectors (7 downto 0) and I did it in a function that returns a std_logic_vector (one of them) so I can read de data several times by calling the function whenever I want. The problem is that I do not know if I can read the data from another function, I have not tried yet, it is a little bit complicated to do it right now at work, I think I could try this weekend , but if you advise me it would be much better:D:D:D. Sorry for my english I speak spanish;)Link Copied

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Calling a function from a function is no problem in VHDL. You can nest functions in any levels of functions. And it will simulate not problem (just dont make some infinitely recursive function)

The problem may come in synthesis - your code needs to map to some real hardware. As long as this is the case, then no problem. But if you're trying to be too clever, it may not synthesise. Post some code that has a problem to discuss further.- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Thanks, I will post the possible problems next Monday after simulation and synthesis. I do not have internet at home :(

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Implementing data storage in procedures and impure functions is more a simulation than hardware synthesis thing in my opinion, even if it's supported by Quartus synthesis.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Hi, as I said last friday, I worked on the calling function form a function last weekend and it was just great!!!!!!!!:):):) Now I am trying to do some things inside the function called in order to achieve may goal. If I have problems I'll post them here. Thanks everyone. ;)

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Remember that functions can only create logic and not registers. Creating complicated functions will create complicated logic that you may not being able to break up easily for pipelining and hence lowering your FMax

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

What I want to do is create a bidimiensional array of integers and I want to do it in a function, but first I need to calculate the values of the integers form a mathematical operation with real numbers, I want it to do it in a for loopinside the function, so while I am doing the math operation and conversion I enter the numbers in the positions of the array. The array has to be bidimensional because I have to access it with two variables as indexes. I do not think that would cause a huge problem. I hope it can be done, what do you think about it Tricky??

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Is this for initialising a ROM? Real values cannot be used in synthesisable code, but they can be used to initialise ROM/RAM contents assuming the ROM/RAM contains a synthesisable type (not real).

If it is for some run-time code, your description makes it sound like it wont map nicely to hardware and probably should not be inside a function. It sounds more like a software description rather than hardware.- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Yes, it is for initializing a rom of integers, the values of the rom are integers converted from a math operation with real numbers, the value of the rom depend on two set of constants an unidimensional array of integers and an unidimensional array of reals. In order to sinthesise the code I convert the result of the math operation in an integer and that is what I save in the rom. Then I expect to read the rom in some process of the program.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Heyyyy :) I did it!!!!!!!!!!!!!!!!!!! I only need to simulate in ModelSim for seeing the values in the rom, but so far I did not receive any error. Thanks for your piece of advise Tricky, I am not finish yet but this is a huge step for my design. I will continue, if I have some kind of trouble I will tell, thanks :o

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page