Showing results for 
Search instead for 
Did you mean: 
Honored Contributor I

"Create symbol file" changes "character" into "Enumerated", Modelsim does not accept


I made a VDHL component: 

entity ent_ser_tx is generic( parity : character:='E' ); ... It compiles in Quartus and Quartus made a symbol file out of it. 


Quartus changed the "character" datatype to the "enumerated" datatype when it generated the symbol file. 


Why,I do not know? 


Then I use the symbol file to instantiate the component in a BDF. 


The type enumerated is shown in the graphic parameter box in the BDF on top of the ser_tx component. 


In this box it is impossible to change the parameter type back to "character"; "Character" does not exist in the BDF selection box for the parameter types. 


Quartus does compile my project, but Modelsim will not.  


error: string literal found where non-array type std.standard.character was expected. 


Modelsim is right; Replacing "E" by 'E', in the VHDL I generated out of the BDF to make a Modelsim project, solves the issue. 


Question: Should I abandon using "character" parameters in VHDL components that are used in bdf or is there another solution? 


Thanks for a reaction, 

0 Kudos
4 Replies
Honored Contributor I

Use string instead. Character is an enumerated type, like std_logic, bit, Boolean and all base types.

Honored Contributor I

Hello Tricky, 


Thanks for the quick answer. 


"string" was the second work around I used yesterday because changing "E" to 'E' was not efficient.  


My question remains partially on the table: is it possible to use character in the Schematic Editor and if so, how can I do it? 


Can I enumerate these types? Can I import them in one way or another? Is there a basic solution that works? 


(Even if one changes to string in Schematic Editor , you have to change the object internally to string or it will not compile Modelsim & Quartus.) 


Best Regards, 

Honored Contributor I

Yes, you would have to change all references of it to string, or just map the internal character to parity(1) (because strings always start at index 1) 

The schematic editor is pretty hobbled for functionality. The best possible fix is just not to use it, and do everything in HDL. That way you can use whatever type you want. 

Using a character seems a little odd anyway. What are you doing with it?
Honored Contributor I

I am using it to define the parity settings of a small UART I built. 'E' means parity even, 'O' means odd and 'N' means none. 

Noting prevents me from using "E" of course.  

The Uart is part of a Profibus DP library for a S7-PLC I am working on. 

At low baud rates the lib works on an Arduino (prototype). 

For high baud rates I will use an FPGA.