Macros with parameters not understood by Leonardo? 
Author Message
 Macros with parameters not understood by Leonardo?

I want to use a macro with a parameter. My simulator says OK but
Leonardo Spectrum says NO.

Has anybody of you been faced with this problem? Do you know a
solution?

Example code:

//definition
`define m_POWER_OF_2(a) ('h1<<a)

// usage

   r_Value <= #10 `m_POWER_OF_2(0);

//answer from leonardo:
"C:/TEST/HDL/TEST.V", line 22: Error, syntax error near: r_VALUE <=
#10 `m_POWER_OF_2(<-

I tried the following definitions:
`define m_POWER_OF_2(a) ('h1<<a)
`define m_POWER_OF_2(a) 'h1<<a
`define m_POWER_OF_2 (a) ('h1<<a)
`define m_POWER_OF_2 (a) 'h1<<a
`define m_POWER_OF_2(a) (9'h1<<a)
`define m_POWER_OF_2 (a) (9'h1<<a)
`define m_POWER_OF_2(a) (9'h1 + a)
and many more.

Thanks!
Juergen



Tue, 21 Jun 2005 18:42:54 GMT  
 Macros with parameters not understood by Leonardo?
If 'a' is fixed you can use parameters, if not, write a small
function.

e.g.

parameter a = 8;
parameter powerof = 'h1<<a;

OR

function m_power_of;
input [X:0] a;
m_power_of = 'h1<<a;
endfunction

Cheers !
rudi
------------------------------------------------
www.asics.ws   - Solutions for your ASIC needs -
FREE IP Cores  -->   http://www.asics.ws/  <---

Quote:

> I want to use a macro with a parameter. My simulator says OK but
> Leonardo Spectrum says NO.

> Has anybody of you been faced with this problem? Do you know a
> solution?

> Example code:

> //definition
> `define m_POWER_OF_2(a) ('h1<<a)

> // usage

>    r_Value <= #10 `m_POWER_OF_2(0);

> //answer from leonardo:
> "C:/TEST/HDL/TEST.V", line 22: Error, syntax error near: r_VALUE <=
> #10 `m_POWER_OF_2(<-

> I tried the following definitions:
> `define m_POWER_OF_2(a) ('h1<<a)
> `define m_POWER_OF_2(a) 'h1<<a
> `define m_POWER_OF_2 (a) ('h1<<a)
> `define m_POWER_OF_2 (a) 'h1<<a
> `define m_POWER_OF_2(a) (9'h1<<a)
> `define m_POWER_OF_2 (a) (9'h1<<a)
> `define m_POWER_OF_2(a) (9'h1 + a)
> and many more.

> Thanks!
> Juergen



Wed, 22 Jun 2005 12:24:14 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Help in understanding macro proposal

2. Leonardo not using CLB muxes

3. Question to synplicity users and other not Leonardo users,

4. understanding macros in lisp

5. Understanding macros

6. Help understanding ELISP Macro

7. MACRO parameter question

8. Help on DDEExecute (Excel Macro as Second Parameter)

9. Dynamic Data Exchange - Macro as Second Parameter of DDEExecute

10. macro (`defines) with parameters

11. macro parameter values in NASM

12. How to use macro parameters in a string

 

 
Powered by phpBB® Forum Software