Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nested macros are not expanded correctly if a macro has arguments ... #162

Closed
veripoolbot opened this issue Apr 10, 2008 · 0 comments
Closed
Assignees

Comments

@veripoolbot
Copy link
Collaborator

@veripoolbot veripoolbot commented Apr 10, 2008


Author Name: Wilson Snyder (@wsnyder)
Original Redmine Issue: 162 from https://www.veripool.org
Original Date: 2008-04-10
Original Assignee: Wilson Snyder (@wsnyder)


This bug was cloned from Perl-RT, rt34948.

Email addresses have have been truncated.

Id: 	34948
Status: 	resolved
Left: 	0 min
Queue: 	Verilog-Perl
Owner: 	Nobody
Requestors: 	admin@

Severity: 	(no value)
X Attachments
debug.out.txt

     * Mon Apr 14 12:41:22 2008 (7.3k) by vmatveye@

Sun Apr 13 11:55:28 2008 admin@ - Ticket created

Subject: 	nested macros are not expanded correctly if a macro has arguments ...
Date: 	Sun, 13 Apr 2008 08:55:09 -0700 (PDT)
To: 	bug-Verilog-Perl@
From: 	Vladimir Matveyenko <admin@>

distribution: Verilog-Perl-3.024.tar.gz

Perl version: v5.8.5 built for x86_64-linux

OS: Linux * 2.6.5-7.283-smp #1 SMP Wed Nov 29 16:55:53 UTC 2006 x86_64 x86_64 x86_64 GNU/Linux

I'm reporting an issue with macro expansion only on linux platform (see above), while works fine on Gygwin OS
(CYGWIN_NT-5.1 ecwm0clloan2 1.5.25(0.156/4/2) 2008-03-05 19:27 i686 Cygwin)

It seems that on linux, if a macro contains an argument and it is nested, it gets all confused.
Thanks.

Here is the verilog code to duplicate the issue: test1.vs
// ----------------------------------------------------------//
`define ADD1A(a) \
`ifdef SIM \
always @(*) a = a + 1; \
`else \
p22add add_1 (a) \
`endif

`define ADD1B \
`ifdef SIM \
always @(*) a = a + 1; \
`else \
p22add add_1 (a) \
`endif

module test1 (input logic a);
/* this macro will not expand correctly */
`ADD1A(a)
/* this macro will expand correctly */
`ADD1B
endmodule
// -----------------------------------------------------------//

// -----------------------------------------------------------//
Here is the result of expansion on Linux (incorrect)
// -----------------------------------------------------------//
168>vppp +define+SIM --simple test1.vs

module test1 (input logic a);
ifdef` SIM always @(*) a = a + 1; else` p22add add_1 (a) endif`
always @(*) a = a + 1;
endmodule

// -----------------------------------------------------------//
Here is the result of expansion on Cygwin OS:
// -----------------------------------------------------------//

10 $ vppp +define+SIM --simple test1.vs
module test1 (input logic a);
always @(*) a = a + 1;
always @(*) a = a + 1;
endmodule

Mon Apr 14 09:00:14 2008 WSNYDER - Correspondence added

I think this was fixed in 3.024. It works for me on linux. So, I suspect
you have 3.023 on your linux platform and 3.024 on Cygwin.

Can you download the 3.024 kit, make, and do
./vppp test1.vs

to run it locally and see if it works? If so you have a older version
somewhere that's getting picked up.

Mon Apr 14 09:00:16 2008 RT_System - Status changed from 'new' to 'open'

Mon Apr 14 12:41:22 2008 vmatveye@ - Correspondence added

Subject: 	Re: [rt.cpan.org #34948] nested macros are not expanded correctly if a macro has arguments ...
Date: 	Mon, 14 Apr 2008 09:40:35 -0700 (PDT)
To: 	bug-Verilog-Perl@
From: 	Vladimir Matveyenko <vmatveye@>

Hello,
According to perldoc output the version of Verilog-Perl is 3.024
I had it installed into a local project area since global perl modules are not allowed.
I also ran the same command with -debug switch and attached it just in case.

Thanks again for your help.
-Vladimir

168> perldoc $PROJ_UTILS/include/perl/lib/5.8.5/x86_64-linux/perllocal.pod

PERLLOCAL(1) User Contributed Perl Documentation PERLLOCAL(1)

Thu Apr 10 16:12:03 2008: "Module" Verilog::Language

? "installed into:
/p/acd/proj/gb2/utils/include/perl/lib/site_perl/5.8.5"
? "LINKTYPE: dynamic"
? "VERSION: 3.024"
? "EXE_FILES: vrename vpm vppp vhier vsplitmodule"

perl v5.8.5 2008?04?10 PERLLOCAL(1)

----- Original Message ----
From: Wilson Snyder via RT <bug-Verilog-Perl@>
To: admin@
Sent: Monday, April 14, 2008 6:00:16 AM
Subject: [rt.cpan.org #34948] nested macros are not expanded correctly if a macro has arguments ...

<URL: http://rt.cpan.org/Ticket/Display.html?id=34948 >

I think this was fixed in 3.024. It works for me on linux. So, I suspect
you have 3.023 on your linux platform and 3.024 on Cygwin.

Can you download the 3.024 kit, make, and do
./vppp test1.vs

to run it locally and see if it works? If so you have a older version
somewhere that's getting picked up.

Mon Apr 14 13:21:19 2008 WSNYDER - Correspondence added

You're definatly running a old version, as these messages changed

>1: RAW 0 0: DEFINE : `define

to something like this in 3.024

1: RAW on s0 dr0: DEFINE : `define

Mon Apr 14 13:21:22 2008 WSNYDER - Status changed from 'open' to 'rejected'

Tue Apr 15 13:38:47 2008 admin@ - Correspondence added

Subject: 	Re: [rt.cpan.org #34948] nested macros are not expanded correctly if a macro has arguments ...
Date: 	Tue, 15 Apr 2008 10:38:32 -0700 (PDT)
To: 	bug-Verilog-Perl@
From: 	Vladimir Matveyenko <admin@>

Hi again,
I have tried 2 times to install the 3.024 version on the lunix and used the same distribution tar file as with Cygwin.
But the issue persists. Is there anything else I can try to determine the reason for my lunix problems.

Thanks

----- Original Message ----
From: Wilson Snyder via RT <bug-Verilog-Perl@>
To: admin@
Sent: Monday, April 14, 2008 10:21:21 AM
Subject: [rt.cpan.org #34948] nested macros are not expanded correctly if a macro has arguments ...

<URL: http://rt.cpan.org/Ticket/Display.html?id=34948 >

You're definatly running a old version, as these messages changed

>1: RAW 0 0: DEFINE : `define

to something like this in 3.024

1: RAW on s0 dr0: DEFINE : `define

Tue Apr 15 13:38:49 2008 RT_System - Status changed from 'rejected' to 'open'

Sun Feb 08 09:14:41 2009 WSNYDER - Correspondence added

I think this is an old issue. If it persists please open an issue on
http://veripool.org, thanks.

Sun Feb 08 09:14:42 2009 WSNYDER - Status changed from 'open' to 'resolved'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.