{"id":2868,"date":"2011-03-07T14:05:56","date_gmt":"2011-03-07T05:05:56","guid":{"rendered":"http:\/\/mkusunoki.net\/?p=2868"},"modified":"2013-12-06T22:03:00","modified_gmt":"2013-12-06T13:03:00","slug":"picoblaze-%e3%81%a7-led%e3%83%94%e3%82%b3%e3%83%94%e3%82%b3","status":"publish","type":"post","link":"https:\/\/mkusunoki.net\/?p=2868","title":{"rendered":"PicoBlaze \u3067 LED\u30d4\u30b3\u30d4\u30b3"},"content":{"rendered":"<p>PicoBlaze \u3067 LED\u30d4\u30b3\u30d4\u30b3\u3067\u3059\u3002\n<\/p>\n<p>\nPicoBlaze \u306b\u3064\u3044\u3066\u306f\u3001 <a href=\"http:\/\/www.xilinx.com\/picoblaze\" title=\"http:\/\/www.xilinx.com\/picoblaze\">http:\/\/www.xilinx.com\/picoblaze<\/a> \u306b\u95a2\u9023\u3059\u308b\u60c5\u5831\u3068<br \/>\nPicoBlaze \u306e\u30a2\u30bb\u30f3\u30d6\u30e9\u306a\u3069\u306e\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<ul>\n<li>\u30ed\u30a4\u30e4\u30ea\u30c6\u30a3\u30d5\u30ea\u30fc\u3067\u4f7f\u7528\u53ef\n<\/li>\n<li>8\u30d3\u30c3\u30c8\u30de\u30a4\u30b3\u30f3\n<\/li>\n<li>\u5168\u3066\u306e\u547d\u4ee4\u306f2\u30af\u30ed\u30c3\u30af\u3067\u5b9f\u884c\u3055\u308c\u308b\n<\/li>\n<li>16\u500b\u306e\u30ec\u30b8\u30b9\u30bf \/ SCRACH PAD RAM(64Byte) \/ ROM(1K x 18bit)\n<\/li>\n<\/ul>\n<p>\n\u30de\u30a4\u30b3\u30f3\u306f\u3001\u30a2\u30bb\u30f3\u30d6\u30e9\u306e\u30bd\u30fc\u30b9(.psm)\u3092 KCPSM3.EXE \u3067\u30a2\u30bb\u30f3\u30d6\u30eb\u3057\u307e\u3059\u3002<br \/>\n\u30a8\u30e9\u30fc\u304c\u7121\u3051\u308c\u3070HDL\u306e\u30bd\u30fc\u30b9 VHDL \u3068 Verilog \u306e\u30bd\u30fc\u30b9\u304c\u51fa\u529b\u3055\u308c\u308b\u306e\u3067<br \/>\n\u3053\u308c\u3092\u30c8\u30c3\u30d7\u30e2\u30b8\u30e5\u30fc\u30eb\u306b\u7d44\u307f\u8fbc\u3081\u3070\u52d5\u304f\u3068\u3044\u3046\u5bf8\u6cd5\u3067\u3059\u3002\n<\/p>\n<p>\nxilinx \u304b\u3089\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u51fa\u6765\u308b KCPSM3.ZIP \u306e\u4e2d\u306b\u306f\u8cc7\u6599\u542b\u3081\u3066\u4e00\u5f0f\u5165\u3063\u3066\u308b\u306e\u3067<br \/>\n\u5927\u4e08\u592b\u3067\u3057\u3087\u3046\u3002\u307e\u305f ug129 \u306e\u30e6\u30fc\u30b6\u30fc\u30ac\u30a4\u30c9\u306b\u306f\u65e5\u672c\u8a9e\u7248PDF(\u65e5\u4ed8\u53e4\u3044\u3067\u3059\u304c\u2026)<br \/>\n\u304c\u3042\u308b\u306e\u3067\u3001\u3053\u308c\u3082\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3057\u3066\u304a\u3051\u3070\u3044\u3044\u3068\u601d\u3044\u307e\u3059\u3002\n<\/p>\n<p>\n\u30a2\u30bb\u30f3\u30d6\u30e9\u306e\u30bd\u30fc\u30b9\n<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\n\t\tADDRESS\t000\r\n\r\nINIT00:\r\n\t\tENABLE\tINTERRUPT\r\n\r\nMAIN00:\t\tLOAD\ts5, 00\r\n\r\nMAIN90:\r\n\t\tOUTPUT\ts5, 01    ; \u30dd\u30fc\u30c81\u306b\u51fa\u529b\u3059\u308b\r\n\t\tADD\ts5, 01\r\n\t\tCALL\tDELAY1s\r\n\t\tJUMP\tMAIN90\r\n\r\n\r\n; ------------------------------------------------------------------------------\r\n; -- \u6642\u9593\u5f85\u3061\r\n; -- 50Mhz = 20ns\r\n; -- 1\u547d\u4ee4 2\u30af\u30ed\u30c3\u30af = 40ns\r\n; -- s0,s1,s2,s3 \r\n; ------------------------------------------------------------------------------\r\nDELAY1us:\tLOAD\ts0, 17\r\nDELAY1us00:\tSUB\ts0, 01\r\n\t\tJUMP\tNZ, DELAY1us00\r\n\t\tRETURN\r\n\r\nDELAY100us:\tLOAD\ts1, 64\r\nDELAY100us00:\tCALL\tDELAY1us\r\n\t\tSUB\ts1, 01\r\n\t\tJUMP\tNZ, DELAY100us00\r\n\t\tRETURN\r\n\r\nDELAY1ms:\tLOAD\ts2, 0A\r\nDELAY1ms00:\tCALL\tDELAY100us\r\n\t\tSUB\ts2, 01\r\n\t\tJUMP\tNZ, DELAY1ms00\r\n\t\tRETURN\r\n\r\nDELAY20ms:\tLOAD\ts3, 14\r\nDELAY20ms00:\tCALL\tDELAY1ms\r\n\t\tSUB\ts3, 01\r\n\t\tJUMP\tNZ, DELAY20ms00\r\n\t\tRETURN\r\n\r\nDELAY1s:\tLOAD\ts4, 32\r\nDELAY1s00:\tCALL\tDELAY20ms\r\n\t\tSUB\ts4, 01\r\n\t\tJUMP\tNZ, DELAY1s00\r\n\t\tRETURN\r\n\r\n; ------------------------------------------------------------------------------\r\n; -- \u5272\u308a\u8fbc\u307f\u30eb\u30fc\u30c1\u30f3\r\n; -- \r\n; ------------------------------------------------------------------------------\r\nINTERRUPT:\r\n;\t\t&amp;lt;&lt;\u30b3\u30fc\u30c9&gt;&gt;\r\n\t\tRETURNI ENABLE\r\n\r\n; ------------------------------------------------------------------------------\r\n; -- \u5272\u308a\u8fbc\u307f\u30d9\u30af\u30bf\r\n; -- \r\n; ------------------------------------------------------------------------------\r\n\t\tADDRESS 3FF\r\n\t\tJUMP\tINTERRUPT\r\n&lt;\/\u30b3\u30fc\u30c9&gt;&lt;\/code&gt;&lt;\/pre&gt;\r\n&lt;p&gt;\r\nVerilog \u306e\u30bd\u30fc\u30b9\r\n&lt;\/p&gt;\r\n&lt;pre&gt;&lt;code&gt;\r\nmodule main (\r\n\tinput wire CLK_50MHZ,\r\n\toutput wire &#x5B;7:0] LED );\r\n\r\nwire RESET;\r\nwire CLKIN_IBUFG_OUT;\r\nwire CLK0_OUT;\r\nwire LOCKED_OUT;\r\nwire \t&#x5B;9:0]\taddress ;\r\nwire \t&#x5B;17:0]\tinstruction ;\r\nwire \t&#x5B;7:0]\tport_id ;\r\nwire \t\twrite_strobe, read_strobe, interrupt_ack ;\r\nwire \t&#x5B;7:0]\tout_port ;\r\nwire \t&#x5B;7:0]\tin_port ;\r\nwire\t\tinterrupt, reset, clk ;\r\n\r\nuser_reset reset00 (\r\n\t.CLOCK(),\r\n\t.RESET()\r\n);\r\n\r\ndcmsp00 dcmsp00 (\r\n\t.CLKIN_IN(CLK_50MHZ), \r\n\t.RST_IN(RESET), \r\n\t.CLKIN_IBUFG_OUT(CLKIN_IBUFG_OUT), \r\n\t.CLK0_OUT(CLK0_OUT),\r\n\t.LOCKED_OUT(LOCKED_OUT)\r\n);\r\n\r\nkcpsm3 CPU00 (\r\n \t.address(address),\r\n \t.instruction(instruction),\r\n \t.port_id(port_id),\r\n \t.write_strobe(write_strobe),\r\n \t.out_port(out_port),\r\n \t.read_strobe(read_strobe),\r\n \t.in_port(in_port),\r\n \t.interrupt(interrupt),\r\n \t.interrupt_ack(interrupt_ack),\r\n \t.reset(RESET),\r\n \t.clk(CLK0_OUT)\r\n);\r\n\r\nled CPU00LED (\r\n\t.address(address),\r\n\t.instruction(instruction),\r\n\t.clk(CLK0_OUT)\r\n);\r\n\r\noutp_sel outp_sel (\r\n\t.port_id(port_id),\r\n\t.write_strobe(write_strobe),\r\n\t.indata(out_port),\r\n\t.otdata(LED)\r\n);\r\n\r\nendmodule\r\n\r\n\/\/\r\n\/\/ Generate RESET PULSE\r\n\/\/\r\nmodule user_reset (\r\n\tinput wire CLOCK,\r\n\toutput wire RESET );\r\n\r\n   \r\n   SRL16 #(.INIT(16&#039;h00FF))\t\/\/ Initial Value of Shift Register\r\n     SRL16_inst (\r\n      .Q(RESET),\t\t\t\/\/ SRL data output\r\n      .A0(1&#039;b1),\t\t\t\/\/ Select&#x5B;0] input\r\n      .A1(1&#039;b1),\t\t\t\/\/ Select&#x5B;1] input\r\n      .A2(1&#039;b1),\t\t\t\/\/ Select&#x5B;2] input\r\n      .A3(1&#039;b1),\t\t\t\/\/ Select&#x5B;3] input\r\n      .CLK(CLOCK),\t\t\/\/ Clock input\r\n      .D(1&#039;b0)\t\t\t\t\/\/ SRL data input\r\n   );\r\n\r\n   \/\/ End of SRL16_inst instantiation\r\nendmodule\r\n\r\nmodule outp_sel (\r\n\tinput wire port_id,\r\n\tinput wire write_strobe,\r\n\tinput wire &#x5B;7:0] indata,\r\n\toutput reg &#x5B;7:0] otdata\r\n);\r\n\r\n\talways @(posedge write_strobe)\r\n\t\tbegin\r\n\t\t\tif(port_id == 1)\r\n\t\t\t\totdata = indata;\r\n\t\tend\t\t\r\n\r\nendmodule\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>PicoBlaze \u3067 LED\u30d4\u30b3\u30d4\u30b3\u3067\u3059\u3002 PicoBlaze \u306b\u3064\u3044\u3066\u306f\u3001 http:\/\/www.xilinx.com\/picoblaze \u306b\u95a2\u9023\u3059\u308b\u60c5\u5831\u3068 PicoBlaze \u306e\u30a2\u30bb\u30f3\u30d6\u30e9\u306a\u3069\u306e\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u304c\u3042\u308a\u307e &hellip; <a href=\"https:\/\/mkusunoki.net\/?p=2868\" class=\"more-link\"><span class=\"screen-reader-text\">&#8220;PicoBlaze \u3067 LED\u30d4\u30b3\u30d4\u30b3&#8221; \u306e<\/span>\u7d9a\u304d\u3092\u8aad\u3080<\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[7],"tags":[201,202,44],"class_list":["post-2868","post","type-post","status-publish","format-standard","hentry","category-kousaku","tag-fpga","tag-picobraze","tag-xilinx-2"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/mkusunoki.net\/index.php?rest_route=\/wp\/v2\/posts\/2868","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mkusunoki.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mkusunoki.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mkusunoki.net\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/mkusunoki.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2868"}],"version-history":[{"count":0,"href":"https:\/\/mkusunoki.net\/index.php?rest_route=\/wp\/v2\/posts\/2868\/revisions"}],"wp:attachment":[{"href":"https:\/\/mkusunoki.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2868"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mkusunoki.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2868"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mkusunoki.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2868"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}