index.html 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. <!doctype html>
  2. <title>CodeMirror: VHDL mode</title>
  3. <meta charset="utf-8"/>
  4. <link rel=stylesheet href="../../doc/docs.css">
  5. <link rel="stylesheet" href="../../lib/codemirror.css">
  6. <script src="../../lib/codemirror.js"></script>
  7. <script src="../../addon/edit/matchbrackets.js"></script>
  8. <script src="vhdl.js"></script>
  9. <style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
  10. <div id=nav>
  11. <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
  12. <ul>
  13. <li><a href="../../index.html">Home</a>
  14. <li><a href="../../doc/manual.html">Manual</a>
  15. <li><a href="https://github.com/codemirror/codemirror">Code</a>
  16. </ul>
  17. <ul>
  18. <li><a href="../index.html">Language modes</a>
  19. <li><a class=active href="#">VHDL</a>
  20. </ul>
  21. </div>
  22. <article>
  23. <h2>VHDL mode</h2>
  24. <div><textarea id="code" name="code">
  25. LIBRARY ieee;
  26. USE ieee.std_logic_1164.ALL;
  27. USE ieee.numeric_std.ALL;
  28. ENTITY tb IS
  29. END tb;
  30. ARCHITECTURE behavior OF tb IS
  31. --Inputs
  32. signal a : unsigned(2 downto 0) := (others => '0');
  33. signal b : unsigned(2 downto 0) := (others => '0');
  34. --Outputs
  35. signal a_eq_b : std_logic;
  36. signal a_le_b : std_logic;
  37. signal a_gt_b : std_logic;
  38. signal i,j : integer;
  39. BEGIN
  40. -- Instantiate the Unit Under Test (UUT)
  41. uut: entity work.comparator PORT MAP (
  42. a => a,
  43. b => b,
  44. a_eq_b => a_eq_b,
  45. a_le_b => a_le_b,
  46. a_gt_b => a_gt_b
  47. );
  48. -- Stimulus process
  49. stim_proc: process
  50. begin
  51. for i in 0 to 8 loop
  52. for j in 0 to 8 loop
  53. a <= to_unsigned(i,3); --integer to unsigned type conversion
  54. b <= to_unsigned(j,3);
  55. wait for 10 ns;
  56. end loop;
  57. end loop;
  58. end process;
  59. END;
  60. </textarea></div>
  61. <script>
  62. var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
  63. lineNumbers: true,
  64. matchBrackets: true,
  65. mode: {
  66. name: "vhdl",
  67. }
  68. });
  69. </script>
  70. <p>
  71. Syntax highlighting and indentation for the VHDL language.
  72. <h2>Configuration options:</h2>
  73. <ul>
  74. <li><strong>atoms</strong> - List of atom words. Default: "null"</li>
  75. <li><strong>hooks</strong> - List of meta hooks. Default: ["`", "$"]</li>
  76. <li><strong>multiLineStrings</strong> - Whether multi-line strings are accepted. Default: false</li>
  77. </ul>
  78. </p>
  79. <p><strong>MIME types defined:</strong> <code>text/x-vhdl</code>.</p>
  80. </article>