Go Back   Velocity Reviews > Newsgroups > VHDL
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply

VHDL - Synthesis and FILE I/O?!

 
Thread Tools Search this Thread
Old 04-03-2007, 04:30 PM   #1
Default Synthesis and FILE I/O?!


I often try to code as generic as possible so it can be reused across
multiple projects. When coding RAMs, ROMs or technology dependent
components, I pass a generic to select what target technology it is
going to be used. For ASIC, usually it is an instantiation of a hard
macro, and for FPGA I code so that the compiler can infer the proper
component.

For ROMs, the ASIC vendor ROM generator creates a text file that has
the contents of the ROM and the ROM model reads this file for
simulations. For FPGA I was forced to declare a constant array and
initialize it with the contents of the ROM. This way there is always
the danger or mismatch between the FPGA version and the ASIC version
of the ROM.

In VHDL and most languages, constants can be declared to call a
function that returns the proper constant value. If synthesis tools
allowed FILE I/O to be used in this context, then the same ROM file
that is generated by the ROM generator could be read in and passed to
the constant and the two implementations would be identical.

This would be a nice feature to have I think. I can think of other
scenarios that function calls and FILE I/O could be used in synthesis.
-- Amal



Amal
  Reply With Quote
Old 04-03-2007, 06:41 PM   #2
Andy
 
Posts: n/a
Default Re: Synthesis and FILE I/O?!
I agree. Once upon a time, I needed to translate a PAL into an FPGA,
and had a vhdl simulation model that would read the fusemap (jedec)
file, and that drove generate statements to create the AND-OR tree.
Since it was all done pre-elaboration, it should be able to work, but
the synthesis tools just threw up their hands and said "We don't
support text io!". Of course, not many synthesizers have separate
analysis and elaboration phases, so maybe there's part of the
problem.

As a work around, if you had a script written in perl, etc. to
translate the memory file into a vhdl package file that declared a
constant with the file's contents, that could work too.

Andy

On Apr 3, 10:30 am, "Amal" <akhailt...@gmail.com> wrote:
> I often try to code as generic as possible so it can be reused across
> multiple projects. When coding RAMs, ROMs or technology dependent
> components, I pass a generic to select what target technology it is
> going to be used. For ASIC, usually it is an instantiation of a hard
> macro, and for FPGA I code so that the compiler can infer the proper
> component.
>
> For ROMs, the ASIC vendor ROM generator creates a text file that has
> the contents of the ROM and the ROM model reads this file for
> simulations. For FPGA I was forced to declare a constant array and
> initialize it with the contents of the ROM. This way there is always
> the danger or mismatch between the FPGA version and the ASIC version
> of the ROM.
>
> In VHDL and most languages, constants can be declared to call a
> function that returns the proper constant value. If synthesis tools
> allowed FILE I/O to be used in this context, then the same ROM file
> that is generated by the ROM generator could be read in and passed to
> the constant and the two implementations would be identical.
>
> This would be a nice feature to have I think. I can think of other
> scenarios that function calls and FILE I/O could be used in synthesis.
> -- Amal





Andy
  Reply With Quote
Old 04-03-2007, 08:30 PM   #3
David R Brooks
 
Posts: n/a
Default Re: Synthesis and FILE I/O?!
Andy wrote:
> I agree. Once upon a time, I needed to translate a PAL into an FPGA,
> and had a vhdl simulation model that would read the fusemap (jedec)
> file, and that drove generate statements to create the AND-OR tree.
> Since it was all done pre-elaboration, it should be able to work, but
> the synthesis tools just threw up their hands and said "We don't
> support text io!". Of course, not many synthesizers have separate
> analysis and elaboration phases, so maybe there's part of the
> problem.
>
> As a work around, if you had a script written in perl, etc. to
> translate the memory file into a vhdl package file that declared a
> constant with the file's contents, that could work too.
>
> Andy
>
> On Apr 3, 10:30 am, "Amal" <akhailt...@gmail.com> wrote:
>> I often try to code as generic as possible so it can be reused across
>> multiple projects. When coding RAMs, ROMs or technology dependent
>> components, I pass a generic to select what target technology it is
>> going to be used. For ASIC, usually it is an instantiation of a hard
>> macro, and for FPGA I code so that the compiler can infer the proper
>> component.
>>
>> For ROMs, the ASIC vendor ROM generator creates a text file that has
>> the contents of the ROM and the ROM model reads this file for
>> simulations. For FPGA I was forced to declare a constant array and
>> initialize it with the contents of the ROM. This way there is always
>> the danger or mismatch between the FPGA version and the ASIC version
>> of the ROM.
>>
>> In VHDL and most languages, constants can be declared to call a
>> function that returns the proper constant value. If synthesis tools
>> allowed FILE I/O to be used in this context, then the same ROM file
>> that is generated by the ROM generator could be read in and passed to
>> the constant and the two implementations would be identical.
>>
>> This would be a nice feature to have I think. I can think of other
>> scenarios that function calls and FILE I/O could be used in synthesis.
>> -- Amal

>
>

I think the latest Xilinx tools can do something of this kind, but of
course, you're not vendor independent (is that an issue for you?)
If vendor-independence is required, then a separate (Perl?) script is
probably the way to go.


David R Brooks
  Reply With Quote
Old 04-03-2007, 10:23 PM   #4
Amal
 
Posts: n/a
Default Re: Synthesis and FILE I/O?!
On Apr 3, 3:30 pm, David R Brooks <daveb...@iinet.net.au> wrote:
> Andy wrote:
> > I agree. Once upon a time, I needed to translate a PAL into an FPGA,
> > and had a vhdl simulation model that would read the fusemap (jedec)
> > file, and that drove generate statements to create the AND-OR tree.
> > Since it was all done pre-elaboration, it should be able to work, but
> > the synthesis tools just threw up their hands and said "We don't
> > support text io!". Of course, not many synthesizers have separate
> > analysis and elaboration phases, so maybe there's part of the
> > problem.

>
> > As a work around, if you had a script written in perl, etc. to
> > translate the memory file into a vhdl package file that declared a
> > constant with the file's contents, that could work too.

>
> > Andy

>
> > On Apr 3, 10:30 am, "Amal" <akhailt...@gmail.com> wrote:
> >> I often try to code as generic as possible so it can be reused across
> >> multiple projects. When coding RAMs, ROMs or technology dependent
> >> components, I pass a generic to select what target technology it is
> >> going to be used. For ASIC, usually it is an instantiation of a hard
> >> macro, and for FPGA I code so that the compiler can infer the proper
> >> component.

>
> >> For ROMs, the ASIC vendor ROM generator creates a text file that has
> >> the contents of the ROM and the ROM model reads this file for
> >> simulations. For FPGA I was forced to declare a constant array and
> >> initialize it with the contents of the ROM. This way there is always
> >> the danger or mismatch between the FPGA version and the ASIC version
> >> of the ROM.

>
> >> In VHDL and most languages, constants can be declared to call a
> >> function that returns the proper constant value. If synthesis tools
> >> allowed FILE I/O to be used in this context, then the same ROM file
> >> that is generated by the ROM generator could be read in and passed to
> >> the constant and the two implementations would be identical.

>
> >> This would be a nice feature to have I think. I can think of other
> >> scenarios that function calls and FILE I/O could be used in synthesis.
> >> -- Amal

>
> I think the latest Xilinx tools can do something of this kind, but of
> course, you're not vendor independent (is that an issue for you?)
> If vendor-independence is required, then a separate (Perl?) script is
> probably the way to go.


A vendor independent solution would be good, although it is hard to
convince vendors to implement a synthesis subset of the language that
there is no hard standard for it.

-- Amal



Amal
  Reply With Quote
Old 04-04-2007, 04:03 AM   #5
Jim Lewis
 
Posts: n/a
Default Re: Synthesis and FILE I/O?!
Amal,
> A vendor independent solution would be good, although it is hard to
> convince vendors to implement a synthesis subset of the language that
> there is no hard standard for it.


So revive 1076.6 working group, get vendors involved, and
update the standard. If you need help, I can advise in the
process.

Cheers,
Jim Lewis


Jim Lewis
  Reply With Quote
Old 04-04-2007, 11:54 AM   #6
Brian Drummond
 
Posts: n/a
Default Re: Synthesis and FILE I/O?!
On 3 Apr 2007 08:30:16 -0700, "Amal" <> wrote:


>For ROMs, the ASIC vendor ROM generator creates a text file that has
>the contents of the ROM and the ROM model reads this file for
>simulations. For FPGA I was forced to declare a constant array and
>initialize it with the contents of the ROM. This way there is always
>the danger or mismatch between the FPGA version and the ASIC version
>of the ROM.
>
>In VHDL and most languages, constants can be declared to call a
>function that returns the proper constant value. If synthesis tools
>allowed FILE I/O to be used in this context, then the same ROM file
>that is generated by the ROM generator could be read in and passed to
>the constant and the two implementations would be identical.


In the absence of synthesisable FILE I/O, your ROM model can use the
"synthesis off" pragmas enclosing a file reader - not to initialise the
constant array from the file - but to ASSERT that the constant array is
identical to the file, with severity FATAL.

You still have duplication, but at least you will catch and eliminate
any mismatch between copies before reaching synthesis.

- Brian


Brian Drummond
  Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Error: Physical sythesis tool PALAC is not supported by Formal Verification tool Conf bbiandov Software 0 12-22-2008 05:25 AM




SEO by vBSEO 3.3.2 ©2009, Crawlability, Inc.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46