Tools/SublimeText
(→VHDL4SublimeText) |
|||
(12 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
{{TOC right}} | {{TOC right}} | ||
+ | |||
+ | {{WarningBox|content='''We recommend using [[Tools/Atom|Atom]] because of it's open source license.'''}} | ||
+ | |||
Sublime Text is a multi-functional text editor: https://www.sublimetext.com/. | Sublime Text is a multi-functional text editor: https://www.sublimetext.com/. | ||
Line 52: | Line 55: | ||
Preferences => Browse Packages => Copy https://github.com/tschinz/sublime_eda/zipball/master | Preferences => Browse Packages => Copy https://github.com/tschinz/sublime_eda/zipball/master | ||
− | + | == VHDL4SublimeText == | |
You find the code snippets derived from Yangsu's sublime-vhdl at https://github.com/dskntIndustry/VHDL4SublimeText.git. | You find the code snippets derived from Yangsu's sublime-vhdl at https://github.com/dskntIndustry/VHDL4SublimeText.git. | ||
Just clone the repo and add the folder sublime-vhdl-master in the Package folder of Sublime Text. | Just clone the repo and add the folder sublime-vhdl-master in the Package folder of Sublime Text. | ||
− | When editing code, you are now able to generate generic code structures when triggering with tab on a reserved word defined by the snippets (XML format) | + | When editing code, you are now able to generate generic code structures when triggering with tab on a reserved word defined by the snippets (XML format). These generic codes are located in the Snippets folder. |
− | Example "Synchronous process" | + | === Example "Synchronous process with asynchronous reset" === |
− | + | ''spro+[tab]'' will generate: | |
− | + | ||
− | spro+[tab] will generate : | + | |
<source lang='vhdl'> | <source lang='vhdl'> | ||
Line 70: | Line 71: | ||
--async reset | --async reset | ||
elsif rising_edge(${2:clock}) then | elsif rising_edge(${2:clock}) then | ||
− | + | --do something | |
end if; | end if; | ||
end process ${1:identifier}; --${1:identifier} | end process ${1:identifier}; --${1:identifier} | ||
Line 79: | Line 80: | ||
The structure '''${1:identifier}''' can be used as below : | The structure '''${1:identifier}''' can be used as below : | ||
− | #'''1''' : the number is used for navigation (with [tab], you move in the generated code) | + | #'''1''' : the number is used for navigation (with [tab], you move in the generated code to change the identifier) |
#'''identifier''' : the label or name of a signal, process... | #'''identifier''' : the label or name of a signal, process... | ||
+ | |||
+ | === Example "FSM" === | ||
+ | ''fsm_mealy+[tab]'' will generate: | ||
+ | |||
+ | <source lang='vhdl'> | ||
+ | -- This goes in architecture declaration part!!!!! | ||
+ | -- Type of state machine. | ||
+ | -- Current and next state declaration. | ||
+ | type fsm_state_type is (init_state, state1, state2, state3); | ||
+ | signal current_state, next_state: fsm_state_type; | ||
+ | |||
+ | -- begin | ||
+ | sync_state_changer_identifier:process(clock, reset) | ||
+ | begin | ||
+ | if reset='1' then | ||
+ | --default state on reset. | ||
+ | current_state <= init_state; | ||
+ | elsif rising_edge(clock) then | ||
+ | --state change. | ||
+ | current_state <= next_state; | ||
+ | end if; | ||
+ | end process sync_state_changer_identifier; | ||
+ | |||
+ | -- processing states part | ||
+ | -- proc_id:process(current_state, in1, in2) | ||
+ | proc_id:process(current_state, all) | ||
+ | begin | ||
+ | -- next_state ≶= current_state; | ||
+ | case current_state is | ||
+ | when init_state => | ||
+ | -- statements | ||
+ | next_state <= state1; | ||
+ | |||
+ | when state1 => | ||
+ | -- statements | ||
+ | next_state <= state2; | ||
+ | |||
+ | when state2 => | ||
+ | -- statements | ||
+ | next_state <= state3; | ||
+ | |||
+ | when state3 => | ||
+ | -- statements | ||
+ | next_state <= init_state; | ||
+ | |||
+ | when others => report "Unreachable state" severity failure; | ||
+ | end case; | ||
+ | end process proc_id; --proc_id | ||
+ | </source> | ||
== Zenburn == | == Zenburn == |
Latest revision as of 15:57, 6 June 2016
|
We recommend using Atom because of it's open source license.
Sublime Text is a multi-functional text editor: https://www.sublimetext.com/.
The Editor is based on plugins in order to extent it's functionality. Some important plugins are listed below. Find more at https://packagecontrol.io/.
Package Control
Needed to install plugins from a marketplace
Installation
Usage
Ctrl + Shift + P =>
- Package Control: Install
- Package Control: Remove
TodoReview
Usage
Simply open your Sublime Text Command Pallet and find the TodoReview: Project Files
command. This will generate your TODO List using all files that are currently in your project, except the ones which are excluded in your settings. If you would like to also include your open files within the search, you can use the TodoReview: Project and Open Files
command; it's that easy! You can then use these results to jump to the corresponding result. Additionally, you can right click a file or folder in your sidebar and select TodoReview to limit your search.
Alignment
Aligns certain user definable pattern. Alignment Ctrl + Shift + P => Package Control: Install Package => Alignment
Usage
Ctrl + Alt + A
Hex Viewer
View Hex Version of a file
Ctrl + Shift + P => Package Control: Install Package => Hex Viewer
Usage
- Hex Viewer = Ctrl + Shift + B, Ctrl + Shift + H
Git
Integrates GIT control into the Editor
Ctrl + Shift + P => Package Control: Install Package => Git
EDA
For syntax highlight of PDC, UCF, VHDL
Preferences => Browse Packages => Copy https://github.com/tschinz/sublime_eda/zipball/master
VHDL4SublimeText
You find the code snippets derived from Yangsu's sublime-vhdl at https://github.com/dskntIndustry/VHDL4SublimeText.git. Just clone the repo and add the folder sublime-vhdl-master in the Package folder of Sublime Text.
When editing code, you are now able to generate generic code structures when triggering with tab on a reserved word defined by the snippets (XML format). These generic codes are located in the Snippets folder.
Example "Synchronous process with asynchronous reset"
spro+[tab] will generate:
${1:identifier}:process(${2:clock}, ${3:reset}) begin if ${3:reset} = '1' then --async reset elsif rising_edge(${2:clock}) then --do something end if; end process ${1:identifier}; --${1:identifier}
Comments :
The structure ${1:identifier} can be used as below :
- 1 : the number is used for navigation (with [tab], you move in the generated code to change the identifier)
- identifier : the label or name of a signal, process...
Example "FSM"
fsm_mealy+[tab] will generate:
-- This goes in architecture declaration part!!!!! -- Type of state machine. -- Current and next state declaration. type fsm_state_type is (init_state, state1, state2, state3); signal current_state, next_state: fsm_state_type; -- begin sync_state_changer_identifier:process(clock, reset) begin if reset='1' then --default state on reset. current_state <= init_state; elsif rising_edge(clock) then --state change. current_state <= next_state; end if; end process sync_state_changer_identifier; -- processing states part -- proc_id:process(current_state, in1, in2) proc_id:process(current_state, all) begin -- next_state ≶= current_state; case current_state is when init_state => -- statements next_state <= state1; when state1 => -- statements next_state <= state2; when state2 => -- statements next_state <= state3; when state3 => -- statements next_state <= init_state; when others => report "Unreachable state" severity failure; end case; end process proc_id; --proc_id
Zenburn
Preferences => Color Scheme => zenburn => zenburn
Nexus Theme
Nice dark theme
Ctrl + Shift + P => Package Control: Install Package => Theme - Nexus