File IO for ROM


Proposal Information

  • Current Owner: JimLewis, ...
  • Contributors: JimLewis, PatrickLehmann, ...
  • Date Proposed: 2014-June-19
  • Date Last Updated: 2016-Feb-12
  • Priority: high
  • Complexity:
  • Focus: General, RTL
  • Related Issues: None
  • Competing Issues: None

Requirement Summary

Define File IO for ROM. Implies defining types for the ROM. Need to be able to read binary, hex, and decimal from the file. Support common file types

See ISAC IR2113

Implementation

Define the following in std_logic_1164:

 -- define type that is an array of std_ulogic_vector
type MemoryArrayType is array (NATURAL range <>) of std_ulogic_vector ; 
-- Make the type name consistent with other matrix types being proposed

-- Define format of file - maybe just one type?  Not too general - use conversions to support less popular types
type MemoryFormatType is (BINARY, OCTAL, DECIMAL, HEX) ; 
type FileFormatType is (TBD) ; 

-- define function to read valeus of Memory Array Type
function ReadMemory (file F: TEXT; FileFmt : FileFormatType ; MemFmt : MemoryFormatType := TBD) return MemoryArrayType ; 
function ReadMemory ( F: string ;  FileFmt : FileFormatType ; MemFmt : MemoryFormatType := TBD) return MemoryArrayType ;
-- Name the function ReadMemV?  Similar to Verilog -- Main.DavidBishop - 2014-06-26

Comments

I think the bigger problem is that some vendors argue, that file I/O is not synthesizable, even at elaboration time. As
long as all std.textio related functions and types are mapped to void or ignored while synthesis, it's not possible to provide
an user defined or open source package.

So the question to me is: How can VHDL "dictate" that file I/O is synthesizable at elaboration time?
Reading and writing should be possible.

From expericence I can say that one tool I'm working with supports file I/O in Verilog but not in VHDL :(.

-- PatrickLehmann - 2016-02-11

Arguments Against

Supporters

-- JimLewis - 2014-06-19 - should be in an open source package until we stabilize it.

-- PatrickLehmann - 2016-02-11

Topic revision: r6 - 2016-02-11 - 23:30:43 - PatrickLehmann
 
Copyright © 2008-2019 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback