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: *

 gray code 

Last post Mon, Oct 29 2012 10:41 AM by Sporadic Crash. 5 replies.
Started by Raullsitec 15 Sep 2009 10:08 AM. Topic has 5 replies and 2559 views
Page 1 of 1 (6 items)
Sort Posts:
  • Tue, Sep 15 2009 10:08 AM

    • Raullsitec
    • Not Ranked
    • Joined on Tue, Sep 15 2009
    • Posts 3
    • Points 60
    gray code Reply

    Hi,

    I would like to know if the type of code for the state machines is configurable in encounter, in particular gray code. Thanks. 

    • Post Points: 20
  • Thu, Oct 29 2009 2:06 PM

    • BobD
    • Top 25 Contributor
    • Joined on Fri, Jul 11 2008
    • Chelmsford, MA
    • Posts 247
    • Points 9,325
    Re: gray code Reply

    Is this question in the context of logical synthesis or digital implementaion?  Which Cadence tool are you running? Let us know and we can route your question appropriately.

    Thanks,
    Bob

    • Post Points: 20
  • Fri, Feb 19 2010 10:08 PM

    • Raullsitec
    • Not Ranked
    • Joined on Tue, Sep 15 2009
    • Posts 3
    • Points 60
    Re: gray code Reply

     In the context of logical synthesis. I am using Cadence Encounter RTL Compiler v 8.1.

     Thank you,

     Raul

    • Post Points: 20
  • Wed, Oct 24 2012 10:23 AM

    • Sporadic Crash
    • Not Ranked
    • Joined on Mon, Sep 8 2008
    • Hamburg, Hamburg
    • Posts 7
    • Points 110
    Re: gray code Reply

    I am interested in Gray coding with RTL Compiler. In the tool following synthetic operators are used:

    BIN2GRAY_STD_LOGIC_OP, GRAY2BIN_STD_LOGIC_OP, INC_GRAY_STD_LOGIC_OP 

    Additionally, following ChipWare components are related to Gray codes.

    CW_inc_gray, CW_gray2bin, CW_cntr_gray, CW_bin2gray 

    There is no known example how to automatically infer Gray codes using RTL coding style only. As you know, synthetic operators are inferred during elaboration runtime, which is a very efficient feature of RTL Compiler. I don't want to use ChipWare components.

    Any help appreciated.  

    Filed under: ,
    • Post Points: 20
  • Mon, Oct 29 2012 7:17 AM

    • grasshopper
    • Top 25 Contributor
    • Joined on Thu, Jul 17 2008
    • Chelmsford, MA
    • Posts 242
    • Points 3,205
    Re: gray code Reply

     Hi Sporadic Crash,

     most synthesis tools do not infer encoding since this could cause all sorts of simulation and equivalency issues. As a result, user has to either encode it in RTL that way or use hand-instantiate CW component. Details on description and instantiation of CW gray components can be found in Chipware Guide in RTL Compiler. You can access through http://support.cadence.com

     

    http://support.cadence.com/wps/myportal/cos/!ut/p/c5/dY1ZDoIwFEXX4gLMe2Wo-omEYsAhWoTSH9IQBwTaOkQjq1cX4D3f51yQ8EWrZ3NSj8Zo1YEASSvixCFJPZyhN6Po5Gy18tLQxYBA8TNohX8WIJQgJ38LWwdybW799ykDgV7FL2iTjLuvdz0siZneU27XZHtI2bzuKNZFF5b5aWjY2EZ-I1rbC21JK5KzUTG59JLvi2Qncxrzwt8crz67Kz-IHpn7jEawXpj-ALbVA5sGow_WN1rC/dl3/d3/L2dBISEvZ0FBIS9nQSEh/

     hope this helps,

    gh-

    • Post Points: 20
  • Mon, Oct 29 2012 10:41 AM

    • Sporadic Crash
    • Not Ranked
    • Joined on Mon, Sep 8 2008
    • Hamburg, Hamburg
    • Posts 7
    • Points 110
    Re: gray code Reply

    Hi gh-, 

    RTL Compiler has no support to control FSM coding style. I vaguely remember even Synplify had a pragma for this (binary, one-hot, gray or Johnson coding).

    I have done an experiment: Synthesized 9-bit binary counter, and then synthesized 9-bit Gray counter (using CW_cntr_gray) using following coding style:

    CW_cntr_gray #(
    .width          ( WIDTH )
    ) my_gray_cntr (
    .clk            ( clk   ), 
    .rst_n          ( ~rst  ), 
    .init_n         ( 1'b1  ), 
    .load_n         ( 1'b1  ), 
    .data           ( {WIDTH{1'b1}} ),
    .cen            ( 1'b1  ), 
    .count          ( gray_cntr )

    After the elaboration, before the synthesis I have flattened this logic and run synthesis with highest effort.

    Area of 9-bit binary counter is 492.831, power consumption is 45.752 uW.

    Area of 9-bit Gray counter (from CW) is 684.196 and power consumption is 51.934 uW.

    For the power measurements I have run gate-level simulations, generated VCD file and I have run another RTL Compiler session in which netlist is read and VCD is annotated on that. This is the flow/setup which gives most accurate power measurements in front end.

    As you see above, Gray coding from CW is not efficient as binary coding.  

     Another observation is the tool behaviour of RTL Compiler during elaboration of CW.

                Reading Verilog file '.../tools.lnx86/lib/chipware/syn/CW/CW_cntr_gray.v'
    Info    : Building ChipWare component. [CDFG-359]
            : Design 'CW__CW_cntr_gray__builtin' from library 'CW' (instantiated from 'dummy dfg') with the parameter(s) width=9 in file '.../tools.lnx86/lib/chipware/syn/CW/CW_cntr_gray.v' on line 1.
        Elaborating block 'CW__CW_cntr_gray__builtin_width9' from file '.../tools.lnx86/lib/chipware/syn/CW/CW_cntr_gray.v'.
    Warning : Unreachable statements for case item. [CDFG-472]
            : Case item 'default' in module 'CW__CW_cntr_gray__builtin_width9' in file '.../tools.lnx86/lib/chipware/syn/CW/CW_cntr_gray.v' on line 1.
    Info    : An implementation was inferred. [CWD-19]
            : The implementation '/hdl_libraries/GB/components/equal_unsigned/implementations/very_fast' was inferred through the binding 'b1' for the call to synthetic operator 'EQ_UNS_OP' (pin widths: A=1 B=1 Z=1) at line 1 in the file '.../tools.lnx86/lib/chipware/syn/CW/CW_cntr_gray.v'.
    Info    : Sorted the set of valid implementations for synthetic operator. [CWD-36]
            : The implementations for the call to synthetic operator 'EQ_UNS_OP' (pin widths: A=1 B=1 Z=1) at line 1 in the file '.../tools.lnx86/lib/chipware/syn/CW/CW_cntr_gray.v' will be considered in the following order: {'/hdl_libraries/GB/components/equal_unsigned/implementations/very_fast' (priority 1)}
    Info    : An implementation was inferred. [CWD-19]
            : The implementation '/hdl_libraries/GB/components/equal_unsigned/implementations/very_fast' was inferred through the binding 'b1' for the call to synthetic operator 'EQ_UNS_OP' (pin widths: A=1 B=1 Z=1) at line 1 in the file '.../tools.lnx86/lib/chipware/syn/CW/CW_cntr_gray.v'.
    Info    : Sorted the set of valid implementations for synthetic operator. [CWD-36]
            : The implementations for the call to synthetic operator 'EQ_UNS_OP' (pin widths: A=1 B=1 Z=1) at line 1 in the file '.../tools.lnx86/lib/chipware/syn/CW/CW_cntr_gray.v' will be considered in the following order: {'/hdl_libraries/GB/components/equal_unsigned/implementations/very_fast' (priority 1)}
    Info    : An implementation was inferred. [CWD-19]
            : The implementation '/hdl_libraries/GB/components/add_unsigned/implementations/very_fast' was inferred through the binding 'b1' for the call to synthetic operator 'ADD_UNS_OP' (pin widths: A=9 B=1 Z=9) at line 1 in the file '.../tools.lnx86/lib/chipware/syn/CW/CW_cntr_gray.v'.
    Info    : Sorted the set of valid implementations for synthetic operator. [CWD-36]
            : The implementations for the call to synthetic operator 'ADD_UNS_OP' (pin widths: A=9 B=1 Z=9) at line 1 in the file '.../tools.lnx86/lib/chipware/syn/CW/CW_cntr_gray.v' will be considered in the following order: {'/hdl_libraries/GB/components/add_unsigned/implementations/very_fast' (priority 1), '/hdl_libraries/GB/components/add_unsigned/implementations/medium' (priority 1), '/hdl_libraries/GB/components/add_unsigned/implementations/slow' (priority 1)}
      Done elaborating 'gray_WIDTH9'.

    As you see, none of the synthetic operators BIN2GRAY_STD_LOGIC_OP, GRAY2BIN_STD_LOGIC_OP, INC_GRAY_STD_LOGIC_OP is inferred. Instead the ones with bold were inferred, which means that RTL Compiler produces not efficient hardware. I have the feeling that this CW is using a binary counter with Gray-code wrapper around it.

    Anyone who can elaborate this is appreciated.

    • Post Points: 5
Page 1 of 1 (6 items)
Sort Posts:
Started by Raullsitec at 15 Sep 2009 10:08 AM. Topic has 5 replies.