{"id":537,"date":"2024-07-29T11:46:46","date_gmt":"2024-07-29T02:46:46","guid":{"rendered":"https:\/\/rtlearner.com\/?p=537"},"modified":"2025-11-13T11:13:26","modified_gmt":"2025-11-13T02:13:26","slug":"verilog-simulation-settings","status":"publish","type":"post","link":"https:\/\/rtlearner.com\/en\/verilog-simulation-settings\/","title":{"rendered":"[Verilog] Simulation \ud658\uacbd \uc138\ud305 (EDA playground, Icarus verilog)"},"content":{"rendered":"<p>In this article, we will introduce an overview of Verilog, one of the HDLs, and its simulation methods.<\/p>\n\n\n<style>.kb-table-of-content-nav.kb-table-of-content-id537_2b8772-ab .kb-table-of-content-wrap{padding-top:var(--global-kb-spacing-sm, 1.5rem);padding-right:var(--global-kb-spacing-sm, 1.5rem);padding-bottom:var(--global-kb-spacing-sm, 1.5rem);padding-left:var(--global-kb-spacing-sm, 1.5rem);box-shadow:0px 0px 14px 0px rgba(0, 0, 0, 0.2);}.kb-table-of-content-nav.kb-table-of-content-id537_2b8772-ab .kb-table-of-contents-title-wrap{padding-top:0px;padding-right:0px;padding-bottom:0px;padding-left:0px;}.kb-table-of-content-nav.kb-table-of-content-id537_2b8772-ab .kb-table-of-contents-title{font-weight:regular;font-style:normal;}.kb-table-of-content-nav.kb-table-of-content-id537_2b8772-ab .kb-table-of-content-wrap .kb-table-of-content-list{font-weight:regular;font-style:normal;margin-top:var(--global-kb-spacing-sm, 1.5rem);margin-right:0px;margin-bottom:0px;margin-left:0px;}@media all and (max-width: 767px){.kb-table-of-content-nav.kb-table-of-content-id537_2b8772-ab .kb-table-of-contents-title{font-size:var(--global-kb-font-size-md, 1.25rem);}.kb-table-of-content-nav.kb-table-of-content-id537_2b8772-ab .kb-table-of-content-wrap .kb-table-of-content-list{font-size:var(--global-kb-font-size-sm, 0.9rem);}}<\/style>\n\n<style>.kadence-column537_953fb7-ed > .kt-inside-inner-col{box-shadow:0px 0px 14px 0px rgba(0, 0, 0, 0.2);}.kadence-column537_953fb7-ed > .kt-inside-inner-col,.kadence-column537_953fb7-ed > .kt-inside-inner-col:before{border-top-left-radius:0px;border-top-right-radius:0px;border-bottom-right-radius:0px;border-bottom-left-radius:0px;}.kadence-column537_953fb7-ed > .kt-inside-inner-col{column-gap:var(--global-kb-gap-sm, 1rem);}.kadence-column537_953fb7-ed > .kt-inside-inner-col{flex-direction:column;}.kadence-column537_953fb7-ed > .kt-inside-inner-col > .aligncenter{width:100%;}.kadence-column537_953fb7-ed > .kt-inside-inner-col:before{opacity:0.3;}.kadence-column537_953fb7-ed{position:relative;}@media all and (max-width: 1024px){.kadence-column537_953fb7-ed > .kt-inside-inner-col{flex-direction:column;justify-content:center;}}@media all and (max-width: 767px){.kadence-column537_953fb7-ed > .kt-inside-inner-col{flex-direction:column;justify-content:center;}}<\/style>\n<div class=\"wp-block-kadence-column kadence-column537_953fb7-ed\"><div class=\"kt-inside-inner-col\">\n<p><strong>Related articles<\/strong><\/p>\n\n\n\n<p>\u2705<a href=\"https:\/\/rtlearner.com\/en\/verilog-syntax\/\">Grammar 1 \u2013 Basic Structure, Procedural Assignment, and Continuous Assignment<\/a><\/p>\n\n\n\n<p>\u2705<a href=\"https:\/\/rtlearner.com\/en\/verilog-syntax-2\/\">Grammar 2 \u2013 Instantiation, Flip-Flops, and Latches<\/a><\/p>\n<\/div><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">What is HDL (Hardware Description Language)?<\/h2>\n\n\n\n<p>HDL is a hardware description language used to design and verify digital systems, from basic components to actual semiconductor chips, and can describe the functions and timing of circuits.<\/p>\n\n\n\n<p>It should be noted that <strong>it is different from general computing languages \u200b\u200bbecause it is a hardware design language, not a software design language.<\/strong>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Why Use HDL?<\/h2>\n\n\n\n<p>So why are semiconductors designed using HDL rather than blueprints?<\/p>\n\n\n<style>.kb-image537_4b0766-24.kb-image-is-ratio-size, .kb-image537_4b0766-24 .kb-image-is-ratio-size{max-width:650px;width:100%;}.wp-block-kadence-column > .kt-inside-inner-col > .kb-image537_4b0766-24.kb-image-is-ratio-size, .wp-block-kadence-column > .kt-inside-inner-col > .kb-image537_4b0766-24 .kb-image-is-ratio-size{align-self:unset;}.kb-image537_4b0766-24 figure{max-width:650px;}.kb-image537_4b0766-24 .image-is-svg, .kb-image537_4b0766-24 .image-is-svg img{width:100%;}.kb-image537_4b0766-24 .kb-image-has-overlay:after{opacity:0.3;}.kb-image537_4b0766-24 img.kb-img, .kb-image537_4b0766-24 .kb-img img{box-shadow:0px 0px 14px 0px rgba(0, 0, 0, 0.2);}@media all and (max-width: 767px){.kb-image537_4b0766-24.kb-image-is-ratio-size, .kb-image537_4b0766-24 .kb-image-is-ratio-size{max-width:250px;width:100%;}.kb-image537_4b0766-24 figure{max-width:250px;}}<\/style>\n<div class=\"wp-block-kadence-image kb-image537_4b0766-24\"><figure class=\"aligncenter\"><a href=\"https:\/\/ko.wikipedia.org\/wiki\/%ED%9A%8C%EB%A1%9C%EB%8F%84\" class=\"kb-advanced-image-link\" target=\"_blank\" rel=\"noopener noreferrer\"><img decoding=\"async\" src=\"https:\/\/blog.kakaocdn.net\/dn\/UFOE0\/btsHSqJQ4ts\/4XhanYYieN7yBDMcvfh760\/img.png\" alt=\"\ud68c\ub85c\ub3c4 \uc608\uc2dc\" class=\"kb-img\"\/><\/a><figcaption>Circuit diagram example<\/figcaption><\/figure><\/div>\n\n\n\n<p>Here's an example circuit diagram. You can see various components and gates. Today's chips are significantly more powerful than their predecessors. As a result, they typically contain hundreds of millions of transistors. Drawing them all individually would be impossible, right?<\/p>\n\n\n\n<p>It is said that in the past, logic gates were designed by drawing them one by one, but after the advent of EDA (Electronic design automation) tools that <strong>synthesize HDL<\/strong> , semiconductor designs are done through HDL.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Setting up the Verilog simulation environment<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">EDA playground<\/h3>\n\n\n\n<p>Verilog is one of the HDLs, just like VHDL. I know that VHDL is used in universities and research institutes, while Verilog is widely used in industry.<\/p>\n\n\n\n<p>Simulation and synthesis are performed using the EDA tools mentioned above. However, most of these tools are paid, so I'd like to introduce you to an <a href=\"https:\/\/edaplayground.com\/\" target=\"_blank\" rel=\"noopener\">EDA playground<\/a>, a free online simulation platform.<\/p>\n\n\n<style>.kb-image537_d109c8-2f.kb-image-is-ratio-size, .kb-image537_d109c8-2f .kb-image-is-ratio-size{max-width:650px;width:100%;}.wp-block-kadence-column > .kt-inside-inner-col > .kb-image537_d109c8-2f.kb-image-is-ratio-size, .wp-block-kadence-column > .kt-inside-inner-col > .kb-image537_d109c8-2f .kb-image-is-ratio-size{align-self:unset;}.kb-image537_d109c8-2f figure{max-width:650px;}.kb-image537_d109c8-2f .image-is-svg, .kb-image537_d109c8-2f .image-is-svg img{width:100%;}.kb-image537_d109c8-2f .kb-image-has-overlay:after{opacity:0.3;}.kb-image537_d109c8-2f img.kb-img, .kb-image537_d109c8-2f .kb-img img{box-shadow:0px 0px 14px 0px rgba(0, 0, 0, 0.2);}@media all and (max-width: 767px){.kb-image537_d109c8-2f.kb-image-is-ratio-size, .kb-image537_d109c8-2f .kb-image-is-ratio-size{max-width:250px;width:100%;}.kb-image537_d109c8-2f figure{max-width:250px;}}<\/style>\n<div class=\"wp-block-kadence-image kb-image537_d109c8-2f\"><figure class=\"aligncenter\"><a href=\"https:\/\/edaplayground.com\/\" class=\"kb-advanced-image-link\" target=\"_blank\" rel=\"noopener noreferrer\"><img decoding=\"async\" src=\"https:\/\/blog.kakaocdn.net\/dn\/bnFeMk\/btsHSEgQSdg\/OQPPmnCMEANm28pfEzMqfK\/img.png\" alt=\"EDA playground \ud648\ud398\uc774\uc9c0\" class=\"kb-img\"\/><\/a><figcaption>Homepage<\/figcaption><\/figure><\/div>\n\n\n\n<p>First, click \"Log in\" in the upper right corner to log in. Then, configure the Tools &amp; Simulators settings in the middle left corner as shown below.<\/p>\n\n\n<style>.kb-image537_b70ef0-05.kb-image-is-ratio-size, .kb-image537_b70ef0-05 .kb-image-is-ratio-size{max-width:200px;width:100%;}.wp-block-kadence-column > .kt-inside-inner-col > .kb-image537_b70ef0-05.kb-image-is-ratio-size, .wp-block-kadence-column > .kt-inside-inner-col > .kb-image537_b70ef0-05 .kb-image-is-ratio-size{align-self:unset;}.kb-image537_b70ef0-05 figure{max-width:200px;}.kb-image537_b70ef0-05 .image-is-svg, .kb-image537_b70ef0-05 .image-is-svg img{width:100%;}.kb-image537_b70ef0-05 .kb-image-has-overlay:after{opacity:0.3;}.kb-image537_b70ef0-05 img.kb-img, .kb-image537_b70ef0-05 .kb-img img{box-shadow:0px 0px 14px 0px rgba(0, 0, 0, 0.2);}@media all and (max-width: 767px){.kb-image537_b70ef0-05.kb-image-is-ratio-size, .kb-image537_b70ef0-05 .kb-image-is-ratio-size{max-width:200px;width:100%;}.kb-image537_b70ef0-05 figure{max-width:200px;}}<\/style>\n<div class=\"wp-block-kadence-image kb-image537_b70ef0-05\"><figure class=\"aligncenter\"><img decoding=\"async\" src=\"https:\/\/blog.kakaocdn.net\/dn\/osFqe\/btsHSE2ewEc\/tc0iZu4JymeToI6WOXE3U1\/img.png\" alt=\"Tools &amp; Simulators\" class=\"kb-img\"\/><figcaption>Tools &amp; Simulators<\/figcaption><\/figure><\/div>\n\n\n\n<p>Icarus Verilog is a free simulation tool. Checking \"Open EPWave after run\" allows you to view the waveform after the simulation is complete.<\/p>\n\n\n\n<p>Then, let's write the following in testbench.sv. You don't need to write design.sv.<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:block;padding:16px 0 0 16px;margin-bottom:-1px;width:100%;text-align:left;background-color:#2e3440ff\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"54\" height=\"14\" viewbox=\"0 0 54 14\"><g fill=\"none\" fill-rule=\"evenodd\" transform=\"translate(1 1)\"><circle cx=\"6\" cy=\"6\" r=\"6\" fill=\"#FF5F56\" stroke=\"#E0443E\" stroke-width=\".5\"><\/circle><circle cx=\"26\" cy=\"6\" r=\"6\" fill=\"#FFBD2E\" stroke=\"#DEA123\" stroke-width=\".5\"><\/circle><circle cx=\"46\" cy=\"6\" r=\"6\" fill=\"#27C93F\" stroke=\"#1AAB29\" stroke-width=\".5\"><\/circle><\/g><\/svg><\/span><span role=\"button\" tabindex=\"0\" data-code=\"module top ();\u00a0\u00a0\u00a0\u00a0initial begin\u00a0\u00a0\u00a0\u00a0#1000\u00a0\u00a0\u00a0\u00a0$finish;\u00a0\u00a0end\u00a0\u00a0endmodule\" style=\"color:#d8dee9ff;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewbox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki nord\" style=\"background-color: #2e3440ff\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #81A1C1\">module<\/span><span style=\"color: #D8DEE9FF\"> top ();<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">\u00a0\u00a0<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">\u00a0\u00a0<\/span><span style=\"color: #81A1C1\">initial<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">begin<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">\u00a0\u00a0\u00a0\u00a0<\/span><span style=\"color: #B48EAD\">#1000<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">\u00a0\u00a0\u00a0\u00a0<\/span><span style=\"color: #88C0D0\">$finish<\/span><span style=\"color: #D8DEE9FF\">;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">\u00a0\u00a0<\/span><span style=\"color: #81A1C1\">end<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">\u00a0\u00a0<\/span><\/span>\n<span class=\"line\"><span style=\"color: #81A1C1\">endmodule<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p>I'll explain what the above code means later. Clicking \"Run\" at the top will start the simulation.<\/p>\n\n\n<style>.kb-image537_0a954d-18.kb-image-is-ratio-size, .kb-image537_0a954d-18 .kb-image-is-ratio-size{max-width:450px;width:100%;}.wp-block-kadence-column > .kt-inside-inner-col > .kb-image537_0a954d-18.kb-image-is-ratio-size, .wp-block-kadence-column > .kt-inside-inner-col > .kb-image537_0a954d-18 .kb-image-is-ratio-size{align-self:unset;}.kb-image537_0a954d-18 figure{max-width:450px;}.kb-image537_0a954d-18 .image-is-svg, .kb-image537_0a954d-18 .image-is-svg img{width:100%;}.kb-image537_0a954d-18 .kb-image-has-overlay:after{opacity:0.3;}.kb-image537_0a954d-18 img.kb-img, .kb-image537_0a954d-18 .kb-img img{box-shadow:0px 0px 14px 0px rgba(0, 0, 0, 0.2);}@media all and (max-width: 767px){.kb-image537_0a954d-18.kb-image-is-ratio-size, .kb-image537_0a954d-18 .kb-image-is-ratio-size{max-width:250px;width:100%;}.kb-image537_0a954d-18 figure{max-width:250px;}}<\/style>\n<div class=\"wp-block-kadence-image kb-image537_0a954d-18\"><figure class=\"aligncenter\"><img decoding=\"async\" src=\"https:\/\/blog.kakaocdn.net\/dn\/dozyVh\/btsHTUpyF74\/Crsd8qnPmomTQT3cZ9QFiK\/img.png\" alt=\"\ucf54\ub4dc \uc785\ub825 \ud6c4 run\" class=\"kb-img\"\/><figcaption>Run after entering the code<\/figcaption><\/figure><\/div>\n\n\n\n<p>Then, the following error code will appear in the Log below.<\/p>\n\n\n\n<p class=\"has-small-font-size\"><strong><mark style=\"background-color:rgba(0, 0, 0, 0);color:#ff0000\" class=\"has-inline-color\">No *.vcd file found. EPWave will not open. Did you use &#8216;$dumpfile(&#8220;dump.vcd&#8221;); $dumpvars;&#8217;?<\/mark><\/strong><\/p>\n\n\n\n<p>This means that the dump file was not created. To view the waveform, you need to create a dump file. Let's modify the code as follows.<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:block;padding:16px 0 0 16px;margin-bottom:-1px;width:100%;text-align:left;background-color:#2e3440ff\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"54\" height=\"14\" viewbox=\"0 0 54 14\"><g fill=\"none\" fill-rule=\"evenodd\" transform=\"translate(1 1)\"><circle cx=\"6\" cy=\"6\" r=\"6\" fill=\"#FF5F56\" stroke=\"#E0443E\" stroke-width=\".5\"><\/circle><circle cx=\"26\" cy=\"6\" r=\"6\" fill=\"#FFBD2E\" stroke=\"#DEA123\" stroke-width=\".5\"><\/circle><circle cx=\"46\" cy=\"6\" r=\"6\" fill=\"#27C93F\" stroke=\"#1AAB29\" stroke-width=\".5\"><\/circle><\/g><\/svg><\/span><span role=\"button\" tabindex=\"0\" data-code=\"module top ();\u00a0\u00a0\u00a0\u00a0\/\/\uc2dc\ubbac\ub808\uc774\uc158 time\u00a0\u00a0initial begin\u00a0\u00a0\u00a0\u00a0#1000\u00a0\u00a0\u00a0\u00a0$finish;\u00a0\u00a0end\u00a0\u00a0\u00a0\u00a0\/\/dump file \ub9cc\ub4e4\uae30\u00a0\u00a0initial begin\u00a0\u00a0\u00a0\u00a0$dumpfile(&quot;dump.vcd&quot;);\u00a0\u00a0\u00a0\u00a0$dumpvars;\u00a0\u00a0end\u00a0\u00a0endmodule\" style=\"color:#d8dee9ff;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewbox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki nord\" style=\"background-color: #2e3440ff\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #81A1C1\">module<\/span><span style=\"color: #D8DEE9FF\"> top ();<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">\u00a0\u00a0<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">\u00a0\u00a0<\/span><span style=\"color: #616E88\">\/\/simulation time<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">\u00a0\u00a0<\/span><span style=\"color: #81A1C1\">initial<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">begin<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">\u00a0\u00a0\u00a0\u00a0<\/span><span style=\"color: #B48EAD\">#1000<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">\u00a0\u00a0\u00a0\u00a0<\/span><span style=\"color: #88C0D0\">$finish<\/span><span style=\"color: #D8DEE9FF\">;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">\u00a0\u00a0<\/span><span style=\"color: #81A1C1\">end<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">\u00a0\u00a0<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">\u00a0\u00a0<\/span><span style=\"color: #616E88\">\/\/Create a dump file<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">\u00a0\u00a0<\/span><span style=\"color: #81A1C1\">initial<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">begin<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">\u00a0\u00a0\u00a0\u00a0<\/span><span style=\"color: #88C0D0\">$dumpfile<\/span><span style=\"color: #D8DEE9FF\">(<\/span><span style=\"color: #A3BE8C\">&quot;dump.vcd&quot;<\/span><span style=\"color: #D8DEE9FF\">);<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">\u00a0\u00a0\u00a0\u00a0<\/span><span style=\"color: #88C0D0\">$dumpvars<\/span><span style=\"color: #D8DEE9FF\">;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">\u00a0\u00a0<\/span><span style=\"color: #81A1C1\">end<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">\u00a0\u00a0<\/span><\/span>\n<span class=\"line\"><span style=\"color: #81A1C1\">endmodule<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p>And if you press run again, a waveform window like the one below will appear.<\/p>\n\n\n<style>.kb-image537_1a588d-a2.kb-image-is-ratio-size, .kb-image537_1a588d-a2 .kb-image-is-ratio-size{max-width:650px;width:100%;}.wp-block-kadence-column > .kt-inside-inner-col > .kb-image537_1a588d-a2.kb-image-is-ratio-size, .wp-block-kadence-column > .kt-inside-inner-col > .kb-image537_1a588d-a2 .kb-image-is-ratio-size{align-self:unset;}.kb-image537_1a588d-a2 figure{max-width:650px;}.kb-image537_1a588d-a2 .image-is-svg, .kb-image537_1a588d-a2 .image-is-svg img{width:100%;}.kb-image537_1a588d-a2 .kb-image-has-overlay:after{opacity:0.3;}.kb-image537_1a588d-a2 img.kb-img, .kb-image537_1a588d-a2 .kb-img img{box-shadow:0px 0px 14px 0px rgba(0, 0, 0, 0.2);}@media all and (max-width: 767px){.kb-image537_1a588d-a2.kb-image-is-ratio-size, .kb-image537_1a588d-a2 .kb-image-is-ratio-size{max-width:250px;width:100%;}.kb-image537_1a588d-a2 figure{max-width:250px;}}<\/style>\n<div class=\"wp-block-kadence-image kb-image537_1a588d-a2\"><figure class=\"aligncenter\"><img decoding=\"async\" src=\"https:\/\/blog.kakaocdn.net\/dn\/dHw9Nb\/btsHSsVlovO\/AwkJV3Cv4aKMgQ1w8k9IiK\/img.png\" alt=\"Waveform\" class=\"kb-img\"\/><figcaption>Waveform<\/figcaption><\/figure><\/div>\n\n\n\n<p>Since we haven't declared anything yet, there's no information in the waveform. So, let's finally modify the code as follows and start the simulation.<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:block;padding:16px 0 0 16px;margin-bottom:-1px;width:100%;text-align:left;background-color:#2e3440ff\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"54\" height=\"14\" viewbox=\"0 0 54 14\"><g fill=\"none\" fill-rule=\"evenodd\" transform=\"translate(1 1)\"><circle cx=\"6\" cy=\"6\" r=\"6\" fill=\"#FF5F56\" stroke=\"#E0443E\" stroke-width=\".5\"><\/circle><circle cx=\"26\" cy=\"6\" r=\"6\" fill=\"#FFBD2E\" stroke=\"#DEA123\" stroke-width=\".5\"><\/circle><circle cx=\"46\" cy=\"6\" r=\"6\" fill=\"#27C93F\" stroke=\"#1AAB29\" stroke-width=\".5\"><\/circle><\/g><\/svg><\/span><span role=\"button\" tabindex=\"0\" data-code=\"module top ();\u00a0\u00a0\u00a0\u00a0\/\/reg \uc120\uc5b8\u00a0\u00a0reg a;\u00a0\u00a0\u00a0\u00a0\/\/reg control\u00a0\u00a0initial begin\u00a0\u00a0\u00a0\u00a0a = 1;\u00a0\u00a0\u00a0\u00a0#100\u00a0\u00a0\u00a0\u00a0a = 0;\u00a0\u00a0\u00a0\u00a0#100\u00a0\u00a0\u00a0\u00a0a = 1;\u00a0\u00a0end\u00a0\u00a0\u00a0\u00a0\/\/\uc2dc\ubbac\ub808\uc774\uc158 time\u00a0\u00a0initial begin\u00a0\u00a0\u00a0\u00a0#1000\u00a0\u00a0\u00a0\u00a0$finish;\u00a0\u00a0end\u00a0\u00a0\u00a0\u00a0\/\/dump file \ub9cc\ub4e4\uae30\u00a0\u00a0initial begin\u00a0\u00a0\u00a0\u00a0$dumpfile(&quot;dump.vcd&quot;);\u00a0\u00a0\u00a0\u00a0$dumpvars;\u00a0\u00a0end\u00a0\u00a0endmodule\" style=\"color:#d8dee9ff;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewbox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki nord\" style=\"background-color: #2e3440ff\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #81A1C1\">module<\/span><span style=\"color: #D8DEE9FF\"> top ();<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">\u00a0\u00a0<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">\u00a0\u00a0<\/span><span style=\"color: #616E88\">\/\/reg declare<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">\u00a0\u00a0<\/span><span style=\"color: #81A1C1\">reg<\/span><span style=\"color: #D8DEE9FF\"> a;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">\u00a0\u00a0<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">\u00a0\u00a0<\/span><span style=\"color: #616E88\">\/\/reg control<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">\u00a0\u00a0<\/span><span style=\"color: #81A1C1\">initial<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">begin<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">\u00a0\u00a0\u00a0\u00a0a <\/span><span style=\"color: #81A1C1\">=<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #B48EAD\">1<\/span><span style=\"color: #D8DEE9FF\">;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">\u00a0\u00a0\u00a0\u00a0<\/span><span style=\"color: #B48EAD\">#100<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">\u00a0\u00a0\u00a0\u00a0a <\/span><span style=\"color: #81A1C1\">=<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #B48EAD\">0<\/span><span style=\"color: #D8DEE9FF\">;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">\u00a0\u00a0\u00a0\u00a0<\/span><span style=\"color: #B48EAD\">#100<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">\u00a0\u00a0\u00a0\u00a0a <\/span><span style=\"color: #81A1C1\">=<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #B48EAD\">1<\/span><span style=\"color: #D8DEE9FF\">;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">\u00a0\u00a0<\/span><span style=\"color: #81A1C1\">end<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">\u00a0\u00a0<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">\u00a0\u00a0<\/span><span style=\"color: #616E88\">\/\/simulation time<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">\u00a0\u00a0<\/span><span style=\"color: #81A1C1\">initial<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">begin<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">\u00a0\u00a0\u00a0\u00a0<\/span><span style=\"color: #B48EAD\">#1000<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">\u00a0\u00a0\u00a0\u00a0<\/span><span style=\"color: #88C0D0\">$finish<\/span><span style=\"color: #D8DEE9FF\">;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">\u00a0\u00a0<\/span><span style=\"color: #81A1C1\">end<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">\u00a0\u00a0<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">\u00a0\u00a0<\/span><span style=\"color: #616E88\">\/\/Create a dump file<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">\u00a0\u00a0<\/span><span style=\"color: #81A1C1\">initial<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">begin<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">\u00a0\u00a0\u00a0\u00a0<\/span><span style=\"color: #88C0D0\">$dumpfile<\/span><span style=\"color: #D8DEE9FF\">(<\/span><span style=\"color: #A3BE8C\">&quot;dump.vcd&quot;<\/span><span style=\"color: #D8DEE9FF\">);<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">\u00a0\u00a0\u00a0\u00a0<\/span><span style=\"color: #88C0D0\">$dumpvars<\/span><span style=\"color: #D8DEE9FF\">;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">\u00a0\u00a0<\/span><span style=\"color: #81A1C1\">end<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">\u00a0\u00a0<\/span><\/span>\n<span class=\"line\"><span style=\"color: #81A1C1\">endmodule<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n<style>.kb-image537_b13cec-dd.kb-image-is-ratio-size, .kb-image537_b13cec-dd .kb-image-is-ratio-size{max-width:650px;width:100%;}.wp-block-kadence-column > .kt-inside-inner-col > .kb-image537_b13cec-dd.kb-image-is-ratio-size, .wp-block-kadence-column > .kt-inside-inner-col > .kb-image537_b13cec-dd .kb-image-is-ratio-size{align-self:unset;}.kb-image537_b13cec-dd figure{max-width:650px;}.kb-image537_b13cec-dd .image-is-svg, .kb-image537_b13cec-dd .image-is-svg img{width:100%;}.kb-image537_b13cec-dd .kb-image-has-overlay:after{opacity:0.3;}.kb-image537_b13cec-dd img.kb-img, .kb-image537_b13cec-dd .kb-img img{box-shadow:0px 0px 14px 0px rgba(0, 0, 0, 0.2);}@media all and (max-width: 767px){.kb-image537_b13cec-dd.kb-image-is-ratio-size, .kb-image537_b13cec-dd .kb-image-is-ratio-size{max-width:250px;width:100%;}.kb-image537_b13cec-dd figure{max-width:250px;}}<\/style>\n<div class=\"wp-block-kadence-image kb-image537_b13cec-dd\"><figure class=\"aligncenter\"><img decoding=\"async\" src=\"https:\/\/blog.kakaocdn.net\/dn\/csjBmK\/btsHTjJYMgU\/UYWNINEHU6eLUHPgVaeodk\/img.png\" alt=\"Waveform result\" class=\"kb-img\"\/><figcaption>Waveform result<\/figcaption><\/figure><\/div>\n\n\n\n<p>You can see that the reg called a changes from 1 -&gt; 0 -&gt; 1. I will explain the above code later.<\/p>\n\n\n\n<p>I tried to run a simulation using Verilog in EDA playground.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Icarus verilog &amp; gtkwave<\/h3>\n\n\n\n<p>EDA Playground is certainly a great site, but it requires an internet connection and a login to use. Furthermore, one drawback is that waveform results cannot be viewed when simulation times are long.<\/p>\n\n\n\n<p>To solve this problem, you can simulate it using a tool called Icarus Verilog on Windows. For instructions on installing Icarus Verilog and GTKwave, please refer to <a href=\"https:\/\/velog.io\/@pikamon\/Verilog-1\" target=\"_blank\" rel=\"noopener\">this article<\/a>.<\/p>\n\n\n\n<p>I saved the top module above as a file named top.v. You can open a command prompt by pressing the Windows key + R and entering \"cmd.\" Then, use the \"cd\" command to navigate to the folder where you saved top.v.<\/p>\n\n\n<style>.kb-image537_d08e05-22.kb-image-is-ratio-size, .kb-image537_d08e05-22 .kb-image-is-ratio-size{max-width:650px;width:100%;}.wp-block-kadence-column > .kt-inside-inner-col > .kb-image537_d08e05-22.kb-image-is-ratio-size, .wp-block-kadence-column > .kt-inside-inner-col > .kb-image537_d08e05-22 .kb-image-is-ratio-size{align-self:unset;}.kb-image537_d08e05-22 figure{max-width:650px;}.kb-image537_d08e05-22 .image-is-svg, .kb-image537_d08e05-22 .image-is-svg img{width:100%;}.kb-image537_d08e05-22 .kb-image-has-overlay:after{opacity:0.3;}.kb-image537_d08e05-22 img.kb-img, .kb-image537_d08e05-22 .kb-img img{box-shadow:0px 0px 14px 0px rgba(0, 0, 0, 0.2);}@media all and (max-width: 767px){.kb-image537_d08e05-22.kb-image-is-ratio-size, .kb-image537_d08e05-22 .kb-image-is-ratio-size{max-width:250px;width:100%;}.kb-image537_d08e05-22 figure{max-width:250px;}}<\/style>\n<div class=\"wp-block-kadence-image kb-image537_d08e05-22\"><figure class=\"aligncenter\"><img decoding=\"async\" src=\"https:\/\/blog.kakaocdn.net\/dn\/NuD1c\/btsIJy0X66K\/dZEVeapnB3piyz0JT1c9NK\/img.png\" alt=\"\uc808\ucc28 \uc124\uba85\" class=\"kb-img\"\/><figcaption>Procedure Description<\/figcaption><\/figure><\/div>\n\n\n\n<p>After that, just enter the command below.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Compile&nbsp;<strong>test.vvp top.v<\/strong>&nbsp;(test.vvp file created)<\/li>\n\n\n\n<li>Running the simulation: vvp&nbsp;<strong>test.vvp<\/strong>&nbsp;(this will create the dump.vcd file that was created in top.v)<\/li>\n\n\n\n<li>Open waveform: gtkwave&nbsp;<strong>dump.vcd<\/strong>&nbsp;(check the waveform window with the generated dump.vcd file)<\/li>\n<\/ul>\n\n\n\n<h4 class=\"wp-block-heading\">Compile<\/h4>\n\n\n\n<p>Enter the file name to be created during compilation (test.vvp) and the file used for compilation (top.v). After compilation, you can see that the test.vvp file has been created in the file list.<\/p>\n\n\n<style>.kb-image537_63fc8b-b3.kb-image-is-ratio-size, .kb-image537_63fc8b-b3 .kb-image-is-ratio-size{max-width:100px;width:100%;}.wp-block-kadence-column > .kt-inside-inner-col > .kb-image537_63fc8b-b3.kb-image-is-ratio-size, .wp-block-kadence-column > .kt-inside-inner-col > .kb-image537_63fc8b-b3 .kb-image-is-ratio-size{align-self:unset;}.kb-image537_63fc8b-b3 figure{max-width:100px;}.kb-image537_63fc8b-b3 .image-is-svg, .kb-image537_63fc8b-b3 .image-is-svg img{width:100%;}.kb-image537_63fc8b-b3 .kb-image-has-overlay:after{opacity:0.3;}.kb-image537_63fc8b-b3 img.kb-img, .kb-image537_63fc8b-b3 .kb-img img{box-shadow:0px 0px 14px 0px rgba(0, 0, 0, 0.2);}@media all and (max-width: 767px){.kb-image537_63fc8b-b3.kb-image-is-ratio-size, .kb-image537_63fc8b-b3 .kb-image-is-ratio-size{max-width:100px;width:100%;}.kb-image537_63fc8b-b3 figure{max-width:100px;}}<\/style>\n<div class=\"wp-block-kadence-image kb-image537_63fc8b-b3\"><figure class=\"aligncenter\"><img decoding=\"async\" src=\"https:\/\/blog.kakaocdn.net\/dn\/5bSAY\/btsIKbxcQgA\/2h8MNnPvi5gFZDMC5BHXAK\/img.png\" alt=\"\ud30c\uc77c \ubaa9\ub85d\" class=\"kb-img\"\/><figcaption>File list<\/figcaption><\/figure><\/div>\n\n\n\n<p>However, as you design, the number of files used for compilation will increase. If the compilation list is top.v module_1.v module_2.v, the compilation command is<\/p>\n\n\n\n<p>iverilog -o&nbsp;<strong>test.vvp top.v module_1.v module_2.v<\/strong><\/p>\n\n\n\n<p>It will be. It's too annoying;;;;; So, you can make a list file and simplify the command. If the list file is called test.f<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/\/test.f\ntop.v\nmodule_1.v\nmodule_2.v<\/code><\/pre>\n\n\n\n<p>Enter it like this and save it. Then, you can get the same compilation result by entering the command like this.<\/p>\n\n\n\n<p>iverilog&nbsp;-o&nbsp;<strong>test.vvp<\/strong>&nbsp;-c&nbsp;<strong>test.f<\/strong><\/p>\n\n\n\n<p>So, if you just modify test.f (list file), you can compile with the same command.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Running the Simulation<\/h4>\n\n\n\n<p>When the actual simulation is run, the dump file set in the initial statement of top.v is created.<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:block;padding:16px 0 0 16px;margin-bottom:-1px;width:100%;text-align:left;background-color:#2e3440ff\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"54\" height=\"14\" viewbox=\"0 0 54 14\"><g fill=\"none\" fill-rule=\"evenodd\" transform=\"translate(1 1)\"><circle cx=\"6\" cy=\"6\" r=\"6\" fill=\"#FF5F56\" stroke=\"#E0443E\" stroke-width=\".5\"><\/circle><circle cx=\"26\" cy=\"6\" r=\"6\" fill=\"#FFBD2E\" stroke=\"#DEA123\" stroke-width=\".5\"><\/circle><circle cx=\"46\" cy=\"6\" r=\"6\" fill=\"#27C93F\" stroke=\"#1AAB29\" stroke-width=\".5\"><\/circle><\/g><\/svg><\/span><span role=\"button\" tabindex=\"0\" data-code=\"\u00a0\u00a0\/\/dump file \ub9cc\ub4e4\uae30\u00a0\u00a0initial begin\u00a0\u00a0\u00a0\u00a0$dumpfile(&quot;dump.vcd&quot;);\u00a0\u00a0\u00a0\u00a0$dumpvars;\u00a0\u00a0end\" style=\"color:#d8dee9ff;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewbox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki nord\" style=\"background-color: #2e3440ff\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #D8DEE9FF\">\u00a0\u00a0<\/span><span style=\"color: #616E88\">\/\/Create a dump file<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">\u00a0\u00a0<\/span><span style=\"color: #81A1C1\">initial<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">begin<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">\u00a0\u00a0\u00a0\u00a0<\/span><span style=\"color: #88C0D0\">$dumpfile<\/span><span style=\"color: #D8DEE9FF\">(<\/span><span style=\"color: #A3BE8C\">&quot;dump.vcd&quot;<\/span><span style=\"color: #D8DEE9FF\">);<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">\u00a0\u00a0\u00a0\u00a0<\/span><span style=\"color: #88C0D0\">$dumpvars<\/span><span style=\"color: #D8DEE9FF\">;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">\u00a0\u00a0<\/span><span style=\"color: #81A1C1\">end<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<h4 class=\"wp-block-heading\">Check the waveform<\/h4>\n\n\n\n<p>Finally, enter the command to open the waveform to view the simulation results. Once the process is complete, delete the dump files (.vcd and .vvp).<\/p>\n\n\n\n<p>Please note that you must check the file names you enter in the command!!!<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Makefile<\/h3>\n\n\n\n<p>When using the Icarus tool, there are separate commands for compiling, running simulations, and checking waveforms. However, memorizing them all individually can be tedious. Using a Makefile can simplify these commands.<\/p>\n\n\n\n<p>This feature automates repetitive commands for files. While originally designed for Linux, it can also be used in Windows environments by installing GNU Make. For installation instructions, see <a href=\"https:\/\/jstar0525.tistory.com\/264\" target=\"_blank\" rel=\"noopener\">this article<\/a>.<\/p>\n\n\n\n<p>Then, create a file called Makefile in the directory where the top.v and test.f files were and enter the code below.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>run:\n\tiverilog -o test.vvp -c test.f\n\ndump:\n\tvvp test.vvp\n\nwave:\n\tgtkwave dump.vcd\n#----------------------------------------------------------------------------------------------------\n# Rule to clean temp files\n#----------------------------------------------------------------------------------------------------\nclean:\n\tdel *.vcd *.vvp<\/code><\/pre>\n\n\n\n<p>This means that the compile, simulation run, and waveform check commands explained above are converted to the commands run, dump, and wave, respectively. \"clean\" means to delete (del) all .vcd and .vvp files. Note that commands like run, dump, wave, and clean can be customized by the user.<\/p>\n\n\n<style>.kb-image537_475547-2c.kb-image-is-ratio-size, .kb-image537_475547-2c .kb-image-is-ratio-size{max-width:300px;width:100%;}.wp-block-kadence-column > .kt-inside-inner-col > .kb-image537_475547-2c.kb-image-is-ratio-size, .wp-block-kadence-column > .kt-inside-inner-col > .kb-image537_475547-2c .kb-image-is-ratio-size{align-self:unset;}.kb-image537_475547-2c figure{max-width:300px;}.kb-image537_475547-2c .image-is-svg, .kb-image537_475547-2c .image-is-svg img{width:100%;}.kb-image537_475547-2c .kb-image-has-overlay:after{opacity:0.3;}.kb-image537_475547-2c img.kb-img, .kb-image537_475547-2c .kb-img img{box-shadow:0px 0px 14px 0px rgba(0, 0, 0, 0.2);}@media all and (max-width: 767px){.kb-image537_475547-2c.kb-image-is-ratio-size, .kb-image537_475547-2c .kb-image-is-ratio-size{max-width:250px;width:100%;}.kb-image537_475547-2c figure{max-width:250px;}}<\/style>\n<div class=\"wp-block-kadence-image kb-image537_475547-2c\"><figure class=\"aligncenter\"><img decoding=\"async\" src=\"https:\/\/blog.kakaocdn.net\/dn\/biRsDi\/btsILFSezqk\/71FpCKY51yQXKRWdnEbPs0\/img.png\" alt=\"\ud30c\uc77c \ubaa9\ub85d\" class=\"kb-img\"\/><figcaption>File list<\/figcaption><\/figure><\/div>\n\n\n\n<p>If you set it up as above, the command to enter in the cmd window is as follows.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Compile: make run<\/li>\n\n\n\n<li>Running the simulation: make dump<\/li>\n\n\n\n<li>waveform check: make wave<\/li>\n\n\n\n<li>Delete the dump files: make clean<\/li>\n<\/ul>\n\n\n<style>.kb-image537_d1fd23-48.kb-image-is-ratio-size, .kb-image537_d1fd23-48 .kb-image-is-ratio-size{max-width:600px;width:100%;}.wp-block-kadence-column > .kt-inside-inner-col > .kb-image537_d1fd23-48.kb-image-is-ratio-size, .wp-block-kadence-column > .kt-inside-inner-col > .kb-image537_d1fd23-48 .kb-image-is-ratio-size{align-self:unset;}.kb-image537_d1fd23-48 figure{max-width:600px;}.kb-image537_d1fd23-48 .image-is-svg, .kb-image537_d1fd23-48 .image-is-svg img{width:100%;}.kb-image537_d1fd23-48 .kb-image-has-overlay:after{opacity:0.3;}.kb-image537_d1fd23-48 img.kb-img, .kb-image537_d1fd23-48 .kb-img img{box-shadow:0px 0px 14px 0px rgba(0, 0, 0, 0.2);}@media all and (max-width: 767px){.kb-image537_d1fd23-48.kb-image-is-ratio-size, .kb-image537_d1fd23-48 .kb-image-is-ratio-size{max-width:250px;width:100%;}.kb-image537_d1fd23-48 figure{max-width:250px;}}<\/style>\n<div class=\"wp-block-kadence-image kb-image537_d1fd23-48\"><figure class=\"aligncenter\"><img decoding=\"async\" src=\"https:\/\/blog.kakaocdn.net\/dn\/ciBERc\/btsIJz7nunM\/oiV7gp13s4Zi9HK701wrIK\/img.png\" alt=\"\uba85\ub839\uc5b4 \uc785\ub825\" class=\"kb-img\"\/><figcaption>Enter a command<\/figcaption><\/figure><\/div>\n\n\n<style>.kadence-column537_f8b226-6c > .kt-inside-inner-col{box-shadow:0px 0px 14px 0px rgba(0, 0, 0, 0.2);}.kadence-column537_f8b226-6c > .kt-inside-inner-col,.kadence-column537_f8b226-6c > .kt-inside-inner-col:before{border-top-left-radius:0px;border-top-right-radius:0px;border-bottom-right-radius:0px;border-bottom-left-radius:0px;}.kadence-column537_f8b226-6c > .kt-inside-inner-col{column-gap:var(--global-kb-gap-sm, 1rem);}.kadence-column537_f8b226-6c > .kt-inside-inner-col{flex-direction:column;}.kadence-column537_f8b226-6c > .kt-inside-inner-col > .aligncenter{width:100%;}.kadence-column537_f8b226-6c > .kt-inside-inner-col:before{opacity:0.3;}.kadence-column537_f8b226-6c{position:relative;}@media all and (max-width: 1024px){.kadence-column537_f8b226-6c > .kt-inside-inner-col{flex-direction:column;justify-content:center;}}@media all and (max-width: 767px){.kadence-column537_f8b226-6c > .kt-inside-inner-col{flex-direction:column;justify-content:center;}}<\/style>\n<div class=\"wp-block-kadence-column kadence-column537_f8b226-6c\"><div class=\"kt-inside-inner-col\">\n<p><strong>Related articles<\/strong><\/p>\n\n\n\n<p>\u2705<a href=\"https:\/\/rtlearner.com\/en\/verilog-syntax\/\">Grammar 1 \u2013 Basic Structure, Procedural Assignment, and Continuous Assignment<\/a><\/p>\n\n\n\n<p>\u2705<a href=\"https:\/\/rtlearner.com\/en\/verilog-syntax-2\/\">Grammar 2 \u2013 Instantiation, Flip-Flops, and Latches<\/a><\/p>\n<\/div><\/div>","protected":false},"excerpt":{"rendered":"<p>In this article, we will look at an overview of Verilog, one of the HDLs, and its simulation methods.<\/p>","protected":false},"author":1,"featured_media":538,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_kadence_starter_templates_imported_post":false,"_kad_post_transparent":"","_kad_post_title":"","_kad_post_layout":"","_kad_post_sidebar_id":"","_kad_post_content_style":"","_kad_post_vertical_padding":"","_kad_post_feature":"","_kad_post_feature_position":"","_kad_post_header":false,"_kad_post_footer":false,"_kad_post_classname":"","footnotes":""},"categories":[39],"tags":[40],"class_list":["post-537","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-verilog","tag-verilog"],"_links":{"self":[{"href":"https:\/\/rtlearner.com\/en\/wp-json\/wp\/v2\/posts\/537","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/rtlearner.com\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/rtlearner.com\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/rtlearner.com\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/rtlearner.com\/en\/wp-json\/wp\/v2\/comments?post=537"}],"version-history":[{"count":10,"href":"https:\/\/rtlearner.com\/en\/wp-json\/wp\/v2\/posts\/537\/revisions"}],"predecessor-version":[{"id":623,"href":"https:\/\/rtlearner.com\/en\/wp-json\/wp\/v2\/posts\/537\/revisions\/623"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/rtlearner.com\/en\/wp-json\/wp\/v2\/media\/538"}],"wp:attachment":[{"href":"https:\/\/rtlearner.com\/en\/wp-json\/wp\/v2\/media?parent=537"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/rtlearner.com\/en\/wp-json\/wp\/v2\/categories?post=537"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/rtlearner.com\/en\/wp-json\/wp\/v2\/tags?post=537"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}<!-- This website is optimized by Airlift. Learn more: https://airlift.net. Template:. Learn more: https://airlift.net. Template: 69b92da9d36f73cd2808d6e8. Config Timestamp: 2026-03-17 10:32:09 UTC, Cached Timestamp: 2026-04-18 14:57:42 UTC -->