• Skip to main content
  • Skip to search
  • Skip to footer
Cadence Home
  • This search text may be transcribed, used, stored, or accessed by our third-party service providers per our Cookie Policy and Privacy Policy.

  1. Community Forums
  2. Functional Verification Shared Code
  3. Specman Makefile generator utility

Stats

  • Locked Locked
  • Replies 4
  • Subscribers 39
  • Views 17292
  • Members are here 0
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Specman Makefile generator utility

StephenH
StephenH over 16 years ago

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.

snmakedeps_v1.0.zip
  • Cancel
  • StephenH
    StephenH over 16 years ago

    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

     

    snmakedeps_v1.2.zip
    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • StephenH
    StephenH over 16 years ago

    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

    snmakedeps_v1.3.zip
    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • rheychrox06
    rheychrox06 over 15 years ago

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

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • StephenH
    StephenH over 15 years ago

    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.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel

Community Guidelines

The Cadence Design Communities support Cadence users and technologists interacting to exchange ideas, news, technical information, and best practices to solve problems and get the most from Cadence technology. The community is open to everyone, and to provide the most value, we require participants to follow our Community Guidelines that facilitate a quality exchange of ideas and information. By accessing, contributing, using or downloading any materials from the site, you agree to be bound by the full Community Guidelines.

© 2025 Cadence Design Systems, Inc. All Rights Reserved.

  • Terms of Use
  • Privacy
  • Cookie Policy
  • US Trademarks
  • Do Not Sell or Share My Personal Information