Intel® Quartus® Prime Software
Intel® Quartus® Prime Design Software, Design Entry, Synthesis, Simulation, Verification, Timing Analysis, System Design (Platform Designer, formerly Qsys)
16609 Discussions

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

Altera_Forum
Honored Contributor II
1,309 Views

Hello, 

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, 

Johi.
0 Kudos
4 Replies
Altera_Forum
Honored Contributor II
395 Views

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

0 Kudos
Altera_Forum
Honored Contributor II
395 Views

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, 

Johi.
0 Kudos
Altera_Forum
Honored Contributor II
395 Views

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?
0 Kudos
Altera_Forum
Honored Contributor II
395 Views

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.  

https://www.youtube.com/watch?v=ilngtisqosk
0 Kudos
Reply