Home > Community > Forums > Functional Verification Shared Code > Specman Makefile generator utility

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

 Specman Makefile generator utility 

Last post Mon, Jan 4 2010 10:17 AM by StephenH. 4 replies.
Started by StephenH 02 Dec 2008 03:31 AM. Topic has 4 replies and 21786 views
Page 1 of 1 (5 items)
Sort Posts:
  • Tue, Dec 2 2008 3:31 AM

    • StephenH
    • Top 25 Contributor
    • Joined on Tue, Sep 2 2008
    • Bristol, Avon
    • Posts 268
    • Points 4,325
    Specman Makefile generator utility Reply

    I've heard lots of people asking for a way to generate Makefiles for Specman code, and it seems there are some who don't use "irun" which takes care of this automatically. So I wrote this little utility to build a basic Makefile based on the compiled and loaded e code.

    It's really easy to use: at any time load the snmakedeps.e into Specman, and use "write makefile <name> [-ignore_test]".
    This will dump a Makefile with a set of variables corresponding to the loaded packages, and targets to build any compiled modules.
    Using -ignore_test will avoid having the test file in the Makefile, in case you switch tests often (who doesn't?).

    It also writes a stub target so you can do "make stub_ncvlog" or "make stub vhdl" etc.

    The targets are pretty basic, I thought it was more useful to #include this into the main Makefile and define your own more complex targets / dependencies as required.

    The package uses the "reflection" facility of the e language, which is now documented since Specman 8.1, so you can extend this utility if you want (please share any enhancements you make).

     Enjoy! :-)

    Steve.

    Steve Hobbs / Applications Engineer / Cadence Functional Verification
    • Post Points: 20
  • Fri, Jan 23 2009 4:13 AM

    • StephenH
    • Top 25 Contributor
    • Joined on Tue, Sep 2 2008
    • Bristol, Avon
    • Posts 268
    • Points 4,325
    Re: Specman Makefile generator utility Reply

    I've updated this utility a bit, to make the targets more useful. Now, even if you only loaded the file into Specman or Specview, the Makefile will have a target for compiling this with sn_compile.sh. Here's an example:
    First, I load a couple of files into Specman:

    specman -c "load snmakedeps ; load vr_ad/e/vr_ad_top ; load vr_xbus/examples/vr_xbus_config.e ; write makefile Makefile.sn -ignore_test"

    Now I use the generated Makefile.sn to incrementally compile my vr_ad_top and vr_xbus_config modules:

    compile make -f Makefile.sn sncompile

    This results in the executables and shared libraries that I can use with specrun/specview or ncsim.

    make -f Makefile.sn stub_ncvhdl stub_ncvlog

    This results in my stubs files being generated. If I already ran the "make sncompile",  the stubs are generated using the compiled code, otherwise they're written using the loaded e code.

    Here's an example of the Makefile.sn that's generated:

     

    ## Auto-generated Makefile for Specman - DO NOT EDIT
    ## compiled module vr_ad_top
    vr_ad_top_files=\
    /export/home/stephenh/Tools/IPCM08.10.004-s/ipcm/util_lib/vr_ad/e/vr_ad_types.e \
    /export/home/stephenh/Tools/IPCM08.10.004-s/ipcm/util_lib/vr_sets/e/vr_sets_interface.e \
    /export/home/stephenh/Tools/IPCM08.10.004-s/ipcm/util_lib/vr_sets/e/vr_sets_internal_proto.e \
    /export/home/stephenh/Tools/IPCM08.10.004-s/ipcm/util_lib/vr_sets/e/vr_set32_mem.e \
    /export/home/stephenh/Tools/IPCM08.10.004-s/ipcm/util_lib/vr_sets/e/vr_set32_nodes.e \
    /export/home/stephenh/Tools/IPCM08.10.004-s/ipcm/util_lib/vr_sets/e/vr_set32_lowlevel.e \
    /export/home/stephenh/Tools/IPCM08.10.004-s/ipcm/util_lib/vr_sets/e/vr_set32_hilevel.e \
    /export/home/stephenh/Tools/IPCM08.10.004-s/ipcm/util_lib/vr_sets/e/vr_set32_rnd.e \
    /export/home/stephenh/Tools/IPCM08.10.004-s/ipcm/util_lib/vr_sets/e/vr_set_inf_mem.e \
    /export/home/stephenh/Tools/IPCM08.10.004-s/ipcm/util_lib/vr_sets/e/vr_set_inf_nodes.e \
    /export/home/stephenh/Tools/IPCM08.10.004-s/ipcm/util_lib/vr_sets/e/vr_set_inf_lowlevel.e \
    /export/home/stephenh/Tools/IPCM08.10.004-s/ipcm/util_lib/vr_sets/e/vr_set_inf_hilevel.e \
    /export/home/stephenh/Tools/IPCM08.10.004-s/ipcm/util_lib/vr_sets/e/vr_set_inf_rnd.e \
    /export/home/stephenh/Tools/IPCM08.10.004-s/ipcm/util_lib/vr_sets/e/vr_sets_top.e \
    /export/home/stephenh/Tools/IPCM08.10.004-s/ipcm/util_lib/vr_ad/e/vr_ad_api.e \
    /export/home/stephenh/Tools/IPCM08.10.004-s/ipcm/util_lib/vr_ad/e/vr_ad_sequence_h.e \
    /export/home/stephenh/Tools/IPCM08.10.004-s/ipcm/util_lib/vr_ad/e/vr_ad_sets.e \
    /export/home/stephenh/Tools/IPCM08.10.004-s/ipcm/util_lib/vr_ad/e/vr_ad_imp.e \
    /export/home/stephenh/Tools/IPCM08.10.004-s/ipcm/util_lib/vr_ad/e/vr_ad_reg_imp.e \
    /export/home/stephenh/Tools/IPCM08.10.004-s/ipcm/util_lib/vr_ad/e/vr_ad_map_imp.e \
    /export/home/stephenh/Tools/IPCM08.10.004-s/ipcm/util_lib/vr_ad/e/vr_ad_sequence.e \
    /export/home/stephenh/Tools/IPCM08.10.004-s/ipcm/util_lib/vr_ad/e/vr_ad_vt_page_slice_patch.e \
    /export/home/stephenh/Tools/IPCM08.10.004-s/ipcm/util_lib/vr_ad/e/vr_ad_vt.e \
    /export/home/stephenh/Tools/IPCM08.10.004-s/ipcm/util_lib/vr_ad/e/vr_ad_predefined_seq.e \
    /export/home/stephenh/Tools/IPCM08.10.004-s/ipcm/util_lib/vr_ad/e/vr_ad_macro.e \
    /export/home/stephenh/Tools/IPCM08.10.004-s/ipcm/util_lib/vr_ad/e/vr_ad_mem_api.e \
    /export/home/stephenh/Tools/IPCM08.10.004-s/ipcm/util_lib/vr_ad/e/vr_ad_mem_imp.e \
    /export/home/stephenh/Tools/IPCM08.10.004-s/ipcm/util_lib/vr_ad/e/vr_ad_mem_obj.e \
    /export/home/stephenh/Tools/IPCM08.10.004-s/ipcm/util_lib/vr_ad/e/vr_ad_mem_vt.e \
    /export/home/stephenh/Tools/IPCM08.10.004-s/ipcm/util_lib/vr_ad/e/vr_ad_top.e

    ## compiled module vr_xbus_config
    vr_xbus_config_files=\
    /export/home/stephenh/Tools/IPCM08.10.004-s/ipcm/ovm_lib/erm_ex_lib/shr_ram/e/shr_ram_main.e \
    /export/home/stephenh/Tools/IPCM08.10.004-s/ipcm/ovm_lib/erm_ex_lib/shr_ram/e/shr_ram_top.e \
    /export/home/stephenh/Tools/IPCM08.10.004-s/ipcm/ovm_lib/erm_ex_lib/vr_xbus/e/vr_xbus_config_h.e \
    /export/home/stephenh/Tools/IPCM08.10.004-s/ipcm/ovm_lib/erm_ex_lib/vr_xbus/e/vr_xbus_types_h.e \
    /export/home/stephenh/Tools/IPCM08.10.004-s/ipcm/ovm_lib/erm_ex_lib/vr_xbus/e/vr_xbus_trans_h.e \
    /export/home/stephenh/Tools/IPCM08.10.004-s/ipcm/ovm_lib/erm_ex_lib/vr_xbus/e/vr_xbus_signal_map_h.e \
    /export/home/stephenh/Tools/IPCM08.10.004-s/ipcm/ovm_lib/erm_ex_lib/vr_xbus/e/vr_xbus_bus_monitor_h.e \
    /export/home/stephenh/Tools/IPCM08.10.004-s/ipcm/ovm_lib/erm_ex_lib/vr_xbus/e/vr_xbus_agent_monitor_h.e \
    /export/home/stephenh/Tools/IPCM08.10.004-s/ipcm/ovm_lib/erm_ex_lib/vr_xbus/e/vr_xbus_agent_h.e \
    /export/home/stephenh/Tools/IPCM08.10.004-s/ipcm/ovm_lib/erm_ex_lib/vr_xbus/e/vr_xbus_env_h.e \
    /export/home/stephenh/Tools/IPCM08.10.004-s/ipcm/ovm_lib/erm_ex_lib/vr_xbus/e/vr_xbus_arbiter_sequence_h.e \
    /export/home/stephenh/Tools/IPCM08.10.004-s/ipcm/ovm_lib/erm_ex_lib/vr_xbus/e/vr_xbus_master_sequence_h.e \
    /export/home/stephenh/Tools/IPCM08.10.004-s/ipcm/ovm_lib/erm_ex_lib/vr_xbus/e/vr_xbus_slave_sequence_h.e \
    /export/home/stephenh/Tools/IPCM08.10.004-s/ipcm/ovm_lib/erm_ex_lib/vr_xbus/e/vr_xbus_bus_monitor.e \
    /export/home/stephenh/Tools/IPCM08.10.004-s/ipcm/ovm_lib/erm_ex_lib/vr_xbus/e/vr_xbus_agent_monitor.e \
    /export/home/stephenh/Tools/IPCM08.10.004-s/ipcm/ovm_lib/erm_ex_lib/vr_xbus/e/vr_xbus_bfm.e \
    /export/home/stephenh/Tools/IPCM08.10.004-s/ipcm/ovm_lib/erm_ex_lib/vr_xbus/e/vr_xbus_arbiter_bfm.e \
    /export/home/stephenh/Tools/IPCM08.10.004-s/ipcm/ovm_lib/erm_ex_lib/vr_xbus/e/vr_xbus_master_bfm.e \
    /export/home/stephenh/Tools/IPCM08.10.004-s/ipcm/ovm_lib/erm_ex_lib/vr_xbus/e/vr_xbus_slave_bfm.e \
    /export/home/stephenh/Tools/IPCM08.10.004-s/ipcm/ovm_lib/erm_ex_lib/vr_xbus/e/vr_xbus_agent.e \
    /export/home/stephenh/Tools/IPCM08.10.004-s/ipcm/ovm_lib/erm_ex_lib/vr_xbus/e/vr_xbus_env.e \
    /export/home/stephenh/Tools/IPCM08.10.004-s/ipcm/ovm_lib/erm_ex_lib/vr_xbus/e/vr_xbus_protocol_checker.e \
    /export/home/stephenh/Tools/IPCM08.10.004-s/ipcm/ovm_lib/erm_ex_lib/vr_xbus/e/vr_xbus_coverage.e \
    /export/home/stephenh/Tools/IPCM08.10.004-s/ipcm/ovm_lib/erm_ex_lib/vr_xbus/e/vr_xbus_end_test.e \
    /export/home/stephenh/Tools/IPCM08.10.004-s/ipcm/ovm_lib/erm_ex_lib/vr_xbus/e/vr_xbus_top.e \
    /export/home/stephenh/Tools/IPCM08.10.004-s/ipcm/ovm_lib/erm_ex_lib/vr_xbus/e/vr_xbus_port_config.e \
    /export/home/stephenh/Tools/IPCM08.10.004-s/ipcm/ovm_lib/erm_ex_lib/vr_xbus/examples/vr_xbus_config.e

    libsn_vr_ad_top.so: $(vr_ad_top_files)
    sn_compile.sh -exe -shlib -enable_DAC /export/home/stephenh/Tools/IPCM08.10.004-s/ipcm/util_lib/vr_ad/e/vr_ad_top.e

    libsn_vr_xbus_config.so: $(vr_xbus_config_files) libsn_vr_ad_top.so
    sn_compile.sh -exe -shlib -enable_DAC /export/home/stephenh/Tools/IPCM08.10.004-s/ipcm/ovm_lib/erm_ex_lib/vr_xbus/examples/vr_xbus_config.e

    sncompile: libsn_vr_xbus_config.so
    echo 'Recompiling e code...'


    # Use 'make stub_<sn_adapter_name>' to build the desired stubs file,
    # for example: 'make stub_ncvhdl'.
    stub_%: $(vr_ad_top_files) $(vr_xbus_config_files)
    if [ -x ./vr_xbus_config ]; then\
    ./vr_xbus_config -c 'write stubs -$*'; \
    else\
    specman -c 'load /export/home/stephenh/Tools/IPCM08.10.004-s/ipcm/ovm_lib/erm_ex_lib/vr_xbus/examples/vr_xbus_config.e ; write stubs -$*';\
    fi

     

    Steve Hobbs / Applications Engineer / Cadence Functional Verification
    • Post Points: 5
  • Thu, Jan 29 2009 1:53 AM

    • StephenH
    • Top 25 Contributor
    • Joined on Tue, Sep 2 2008
    • Bristol, Avon
    • Posts 268
    • Points 4,325
    Re: Specman Makefile generator utility Reply

    At risk of producing a monologue that nobody is reading... ;-)

    A colleague asked if I could update the generator to produce a "tarball" target, to make it easy to archive or transfer the source code.
    So here it is! The Specman command is unchanged, you simply have a new make target called tarball:

    make -f Makefile.sn tarball

    Steve Hobbs / Applications Engineer / Cadence Functional Verification
    • Post Points: 5
  • Fri, Dec 25 2009 2:06 AM

    • rheychrox06
    • Not Ranked
    • Joined on Fri, Dec 25 2009
    • <?xml version="1.0" encoding="utf-16"?><string>Washington, DC</string>
    • Posts 1
    • Points 20
    Re: Specman Makefile generator utility Reply

     Oh,..this seems to be quite complicated..

    • Post Points: 20
  • Mon, Jan 4 2010 10:17 AM

    • StephenH
    • Top 25 Contributor
    • Joined on Tue, Sep 2 2008
    • Bristol, Avon
    • Posts 268
    • Points 4,325
    Re: Specman Makefile generator utility Reply

    Aww... It wasn't supposed to be complex.

    Drop me an email if you'd like some help using it, maybe my forum post didn't make it very clear which bits are generated and which you have to do. Normally it should be only 1 command.

    Steve Hobbs / Applications Engineer / Cadence Functional Verification
    • Post Points: 5
Page 1 of 1 (5 items)
Sort Posts:
Started by StephenH at 02 Dec 2008 03:31 AM. Topic has 4 replies.