Home > Community > Forums > Functional Verification > unsynthesisable keyword - typedef enum ?

Email

* Required Fields

Recipients email * (separate multiple addresses with commas)

Your name *

Your email *

Message *

Contact Us

* Required Fields
First Name *

Last Name *

Email *

Company / Institution *

Comments: *

 unsynthesisable keyword - typedef enum ? 

Last post Thu, Aug 16 2007 8:42 AM by archive. 7 replies.
Started by archive 16 Aug 2007 08:42 AM. Topic has 7 replies and 2227 views
Page 1 of 1 (8 items)
Sort Posts:
  • Thu, Aug 16 2007 8:42 AM

    • archive
    • Top 75 Contributor
    • Joined on Fri, Jul 4 2008
    • Posts 88
    • Points 4,950
    unsynthesisable keyword - typedef enum ? Reply

    Hi there,

    I ve written a program by using typedef enum as shown below and it cannot be synthesis. Syntax Error stated :
    - Expecting module level statement
    - Expecting target variable, got p_state - Misspelling?
    - Expecting radix character (one of b, o, h, or d) or unsized single bit literal (one of '1, '0, 'x, 'z)

    Can anyone give me some advice on this? thank you very much.

    typedef enum logic [2:0]{
     Idle = 0,
     Fetch = 1,
     Exe = 2
    } state_type;
    state_type p_state, n_state;

    always @ ( posedge clk or negedge nreset)
    begin
      if (~nreset)
        p_state = state_type'(Idle);
      else if (clk)
        p_state = n_state;
    end


    Originally posted in cdnusers.org by SHL
    • Post Points: 0
  • Thu, Aug 16 2007 9:38 AM

    • archive
    • Top 75 Contributor
    • Joined on Fri, Jul 4 2008
    • Posts 88
    • Points 4,950
    RE: unsynthesisable keyword - typedef enum ? Reply

    You stated that this is in a program block. I would consider program blocks to be used only in testbench and not synthesizable. Try changing the program/endprogram to a module/endmodule and see if that resolves the problem.

    TIm


    Originally posted in cdnusers.org by tpylant
    • Post Points: 0
  • Thu, Aug 16 2007 3:21 PM

    • archive
    • Top 75 Contributor
    • Joined on Fri, Jul 4 2008
    • Posts 88
    • Points 4,950
    RE: unsynthesisable keyword - typedef enum ? Reply

    Hi Tim,

    Sorry. I am actually writting a module and wish to synthesis it. It is a Controller block.

    SHL


    Originally posted in cdnusers.org by SHL
    • Post Points: 0
  • Fri, Aug 17 2007 10:22 AM

    • archive
    • Top 75 Contributor
    • Joined on Fri, Jul 4 2008
    • Posts 88
    • Points 4,950
    RE: unsynthesisable keyword - typedef enum ? Reply

    Are you using RC (RTL Compiler)? Using RC 6.2 and RC 7.1 with the '-sv' switch, it ran through RC (read_hdl/elab/synth) quickly without any issues or messages at all. Resulting structure looks likie what I'd expect based on the always block.

    If you're still having problems, you'll probably get better answers by posting to the Synthesis forum (http://www.cdnusers.org/Forums/tabid/52/view/topics/forumid/17/Default.aspx).

    Tim


    Originally posted in cdnusers.org by tpylant
    • Post Points: 0
  • Fri, Aug 17 2007 1:53 PM

    • archive
    • Top 75 Contributor
    • Joined on Fri, Jul 4 2008
    • Posts 88
    • Points 4,950
    RE: unsynthesisable keyword - typedef enum ? Reply

    Im using Synplify Pro 8.6 as my synthesis tool.


    Originally posted in cdnusers.org by SHL
    • Post Points: 0
  • Fri, Aug 17 2007 2:30 PM

    • archive
    • Top 75 Contributor
    • Joined on Fri, Jul 4 2008
    • Posts 88
    • Points 4,950
    RE: unsynthesisable keyword - typedef enum ? Reply

    I would advise checking with Synplify on their support SystemVerilog. From the IUS and RC side, your code is supported.

    Tim


    Originally posted in cdnusers.org by tpylant
    • Post Points: 0
  • Mon, Aug 20 2007 3:43 AM

    • archive
    • Top 75 Contributor
    • Joined on Fri, Jul 4 2008
    • Posts 88
    • Points 4,950
    RE: unsynthesisable keyword - typedef enum ? Reply

    Posted By SHL on 8/17/2007 1:53 PM
    Im using Synplify Pro 8.6 as my synthesis tool.
    Hi SHL,
        As Tim suggested you should work with Synplicty for this. Or you can drop me an email separately via ajeetha <> gmail.com or akumari <> noveldv.com for this issue, I've a working example for you that runs with Synplicity.

    Meanwhile in your code 2 comments:

    1. You should use NBA in sequential block.
    2. Why do you need typecasting on p_state = Idle?

    Try the folloing code in latest version (8.9 version):



    typedef enum logic ?:0]{
     Idle = 0,
     Fetch = 1,
     Exe = 2
    } state_type;
    state_type p_state, n_state;

    always @ ( posedge clk or negedge nreset)
    begin
      if (~nreset)
        p_state <= Idle;
      else if (clk)
        p_state <= n_state;
    end



    HTH
    Ajeetha, CVC
    www.noveldv.com


    Originally posted in cdnusers.org by ajeetha
    • Post Points: 0
  • Mon, Aug 20 2007 3:44 AM

    • archive
    • Top 75 Contributor
    • Joined on Fri, Jul 4 2008
    • Posts 88
    • Points 4,950
    RE: unsynthesisable keyword - typedef enum ? Reply

    Posted By SHL on 8/17/2007 1:53 PM
    Im using Synplify Pro 8.6 as my synthesis tool.
    Hi SHL,
        As Tim suggested you should work with Synplicty for this. Or you can drop me an email separately via ajeetha <> gmail.com or akumari <> noveldv.com for this issue, I've a working example for you that runs with Synplicity.

    Meanwhile in your code 2 comments:

    1. You should use NBA in sequential block.
    2. Why do you need typecasting on p_state = Idle?

    Try the folloing code in latest version (8.9 version):



    typedef enum logic ?:0]{
     Idle = 0,
     Fetch = 1,
     Exe = 2
    } state_type;
    state_type p_state, n_state;

    always @ ( posedge clk or negedge nreset)
    begin
      if (~nreset)
        p_state <= Idle;
      else if (clk)
        p_state <= n_state;
    end



    HTH
    Ajeetha, CVC
    www.noveldv.com


    Originally posted in cdnusers.org by ajeetha
    • Post Points: 0
Page 1 of 1 (8 items)
Sort Posts:
Started by archive at 16 Aug 2007 08:42 AM. Topic has 7 replies.