New Genesis version (r10324) -- Your action may be required

1 view
Skip to first unread message

Ofer Shacham

unread,
Mar 29, 2012, 3:40:13 AM3/29/12
to genesis...@googlegroups.com, Sameh Galal
Hi Everyone,

I'm releasing a new Genesis version with some new features and cleaner build process. You don't need to change your design, but you may need to tweak your makefile a little this time (the good news are that it makes your makefile simpler!). 

At Stanford:
In order to let you make the changes first, I am uploading the new version to /cad, but not making it default yet. To try it, simply use "module load genesis2/r10324".

Other locations:
Send me a note when you're ready and I'll send you the tar.bz file. 

What's new?
  1. genesis2-mode for emacs -- Finally, syntax highlighting for both the verilog code and the perl code surrounding it. This has been long awaited for. It is still flaky at times, but such an incredible improvement! 
    See here, for downloading the mode files and instructions for setting genesis2-mode as your default mode for .vp/.svp file. 
  2. New parameter manipulation methods (also documented on the here on the wiki of course):
    sub exists_param
    API method for checking whether a certain parameter exists in a module (without defining it). Can operate on $self or any template $obj that was previously generated.
    //; my $exists = $self->exists_param('SomePrmName');
    

    sub list_params

    API method for extracting a list of params defined in a module. Can operate on $self or any template $obj that was previously generated.
    //; my @list = $self->list_params();
    
  3. genesis_clean.cmd -- That's it, I'm tired of making the makefile understand what and when to clean. Instead, for every genesis run, there will be a file created, that contains instructions to remove all the files genesis generated. Simply source it to get your folder back in clean shape. Makefile code snippet:
    ...
    .PHONY clean genesis_clean
    genesis_clean:
           source genesis_clean.cmd

    clean: genesis_clean
      
         \rm -f <someFilesYouDon'tLike>
           \rm -f <MoreFilesYouDon'tLike>
    ...

    (See end of this email for a more complete makefile example)
  4. genesis_work directory -- Aren't you tired from all those .pm files showing up in your testrun folder? Well, no more. From now on they are going to be generated in a genesis_work directory. BUT, depending on how you built your makefile, that might require a small change. Most people have two rules for genesis: 'parse', and 'gen'. Really, you should not care about these two steps so we should just merge them. I am happy to help anyone who needs makefile help get this done. This is really a simple change but makefiles are annoying if you are not used to writing them. To make your life easier, since most people are still using makefiles which are based on mine, you can simply replace the red code with the green code that follows:
Replace:
GENESIS_INTERMIDS := $(GENESIS_INPUTS)
GENESIS_INTERMIDS := $(GENESIS_INTERMIDS:.vp=.pm)
GENESIS_INTERMIDS := $(GENESIS_INTERMIDS:.svp=.pm)
With: nothing.

Replace:
GENESIS_PARSE_FLAGS := -parse $(GENESIS_SRC) $(GENESIS_INC) \
  -debug $(GENESIS_DBG_LEVEL)
With:
GENESIS_PARSE_FLAGS := -parse $(GENESIS_SRC) $(GENESIS_INC)
Replace:
# Genesis2 rules:
#####################
# Genesis2 Parse:
# This is the rule to activate Genesis2 parser to generate perl module (.pm)
# from the input verilog preprocessed (.vp) files.
# Use "make PARSE=<genesis2_parse_flags>" to add elaboration time flags
%.pm: %.vp
@echo ""
@echo Making $@ because of $?
@echo ==================================================
Genesis2.pl $(GENESIS_PARSE_FLAGS) -input $? $(PARSE)

%.pm: %.svp
@echo ""
@echo Making $@ because of $?
@echo ==================================================
Genesis2.pl $(GENESIS_PARSE_FLAGS) -input $? $(PARSE)

# Genesis2 Generate:
# This is the rule to activate Genesis2 generator to generate verilog 
# files (_unqN.v) from the perl (.pm) program.
# Use "make GEN=<genesis2_gen_flags>" to add elaboration time flags
$(GENESIS_VLOG_LIST): $(GENESIS_INTERMIDS) $(GENESIS_CFG_XML)
@echo ""
@echo Making $@ because of $?
@echo ==================================================
Genesis2.pl $(GENESIS_GEN_FLAGS) $(GEN)

# phony rules for partial compilation process
.PHONY: parse gen

parse: $(GENESIS_INTERMIDS)

gen: $(GENESIS_VLOG_LIST)

With:
# Genesis2 rules:
#####################
# This is the rule to activate Genesis2 generator to generate verilog 
# files (_unqN.v) from the genesis (.vp) program.
# Use "make GEN=<genesis2_gen_flags>" to add elaboration time flags
$(GENESIS_VLOG_LIST): $(GENESIS_INPUTS) $(GENESIS_CFG_XML)
@echo ""
@echo Making $@ because of $?
@echo ==================================================
Genesis2.pl $(GENESIS_GEN_FLAGS) $(GEN) $(GENESIS_PARSE_FLAGS) -input $(GENESIS_INPUTS) -debug $(GENESIS_DBG_LEVEL)

# phony rules for verilog generation process
.PHONY: gen genesis_clean
gen: $(GENESIS_VLOG_LIST)

genesis_clean:
@echo ""
@echo Cleanning previous runs of Genesis
@echo ===================================
if test -f "genesis_clean.cmd"; then \
source genesis_clean.cmd; \
fi

Replace:
clean:
@echo ""
@echo Cleanning old files, objects, logs and garbage
@echo ==================================================
\rm -rf <BounchOfFiles>
\rm -rf <AnotherBounchOfFiles>
\rm -rf $(GENESIS_INTERMIDS)
\rm -rf $(GENESIS_INTERMIDS:.pm=_unq*.v)
\rm -rf $(GENESIS_INTERMIDS:.pm=_tmp*.v)
\rm -rf depend.list $(GENESIS_VLOG_LIST) $(GENESIS_HIERARCHY) small_$(GENESIS_HIERARCHY)
With:
clean: genesis_clean
@echo ""
@echo Cleanning old files, objects, logs and garbage
@echo ==================================================
\rm -rf <BounchOfFiles>
\rm -rf <AnotherBounchOfFiles>

Please don't hesitate to let me know if/when something does not work or does not make sense,
Ofer.

--

Ofer Shacham, PhD
Stanford University / Chip Genesis, Inc.  
Mailto:sha...@alumni.stanford.edu
Phone: 1-650-8626017


Reply all
Reply to author
Forward
0 new messages