-
Notifications
You must be signed in to change notification settings - Fork 2
Add formattter for genus tcl #102
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
826ac03
ed595a8
afc71bc
da24f0f
b831f30
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,41 @@ | ||
| # frozen_string_literal: true | ||
|
|
||
| module FLGen | ||
| class CommonTCLFormatter < Formatter | ||
| def format_header_line(line) | ||
| "# #{line}" | ||
| end | ||
|
|
||
| def pre_macros(io) | ||
| io.puts('set flgen_defines {}') | ||
| end | ||
|
|
||
| def format_macro(macro, value) | ||
| end | ||
|
|
||
| def post_macros(io) | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. same as |
||
| end | ||
|
|
||
| def pre_include_directories(io) | ||
| io.puts('set flgen_include_directories {}') | ||
| end | ||
|
|
||
| def format_include_directory(directory) | ||
| "lappend flgen_include_directories \"#{directory}\"" | ||
| end | ||
|
|
||
| def post_include_directories(io) | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. same as |
||
| end | ||
|
|
||
| def pre_source_files(io) | ||
| io.puts('set flgen_source_files {}') | ||
| end | ||
|
|
||
| def format_file_path(path) | ||
| "lappend flgen_source_files \"#{path}\"" | ||
| end | ||
|
|
||
| def post_source_files(io) | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. same as |
||
| end | ||
| end | ||
| end | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| # frozen_string_literal: true | ||
|
|
||
| require_relative 'common_tcl_formatter' | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please move this like to |
||
|
|
||
| module FLGen | ||
| class GenusTCLFormatter < CommonTCLFormatter | ||
| def format_macro(macro, value) | ||
| if value.nil? | ||
| "lappend flgen_defines -define #{macro}" | ||
| else | ||
| "lappend flgen_defines -define #{macro}=#{value}" | ||
| end | ||
| end | ||
|
|
||
| def post_include_directories(io) | ||
| io.puts("set_db init_hdl_search_path $flgen_include_directories") | ||
| end | ||
|
|
||
| def post_source_files(io) | ||
| io.puts("if {![info exists flgen_defines]} {set flgen_defines {}}") | ||
| io.puts("read_hdl -lib worklib {*}$flgen_defines -sv $flgen_source_files") | ||
| end | ||
|
|
||
| Formatter.add_formatter(:'genus-tcl', self) | ||
| end | ||
| end | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This method is also defined in the base formatter class. Please remove it from the
CommonTCLFormatterclass.