OSDN Git Service

first commit
authorbols <bols-blue@lnc.jp>
Mon, 20 Jun 2011 08:43:52 +0000 (17:43 +0900)
committerbols <bols-blue@lnc.jp>
Mon, 20 Jun 2011 08:43:52 +0000 (17:43 +0900)
PS2keyboard/.project [new file with mode: 0644]
PS2keyboard/IOrach.nsh [new file with mode: 0644]
PS2keyboard/IOrach.nsl [new file with mode: 0644]
PS2keyboard/keyboarddata.nsh [new file with mode: 0644]
PS2keyboard/keyboarddata.nsl [new file with mode: 0644]
PS2keyboard/top.nsl [new file with mode: 0644]

diff --git a/PS2keyboard/.project b/PS2keyboard/.project
new file mode 100644 (file)
index 0000000..4345898
--- /dev/null
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+       <name>PS2key</name>
+       <comment></comment>
+       <projects>
+       </projects>
+       <buildSpec>
+               <buildCommand>
+                       <name>jp.co.overtone.nslplugin_core.NSLToVerilogProjectBuilder</name>
+                       <arguments>
+                       </arguments>
+               </buildCommand>
+               <buildCommand>
+                       <name>jp.co.overtone.nslplugin_core.NSLToVHDLProjectBuilder</name>
+                       <arguments>
+                       </arguments>
+               </buildCommand>
+               <buildCommand>
+                       <name>jp.co.overtone.nslplugin_core.NSLToSystemCProjectBuilder</name>
+                       <arguments>
+                       </arguments>
+               </buildCommand>
+       </buildSpec>
+       <natures>
+               <nature>jp.co.overtone.nslplugin_core.NSLPlojectNature</nature>
+       </natures>
+</projectDescription>
diff --git a/PS2keyboard/IOrach.nsh b/PS2keyboard/IOrach.nsh
new file mode 100644 (file)
index 0000000..5254b8b
--- /dev/null
@@ -0,0 +1,5 @@
+declare IOrach interface{
+       input datain;
+       input m_clock;
+       output dataout ;
+}
diff --git a/PS2keyboard/IOrach.nsl b/PS2keyboard/IOrach.nsl
new file mode 100644 (file)
index 0000000..e0ccaad
--- /dev/null
@@ -0,0 +1,10 @@
+#include <IOrach.nsh>
+module IOrach{
+       reg buff[2];
+       
+       {
+               buff := {buff[0],datain};
+               dataout = buff[1];
+       }
+       
+}
diff --git a/PS2keyboard/keyboarddata.nsh b/PS2keyboard/keyboarddata.nsh
new file mode 100644 (file)
index 0000000..8d65315
--- /dev/null
@@ -0,0 +1,4 @@
+declare keyboarddata{
+       input datain,sync;
+       output outputByteE;
+}
diff --git a/PS2keyboard/keyboarddata.nsl b/PS2keyboard/keyboarddata.nsl
new file mode 100644 (file)
index 0000000..60eb2dc
--- /dev/null
@@ -0,0 +1,21 @@
+#include "keyboarddata.nsh"
+
+module keyboarddata{
+       reg old_sync;
+       func_self syncdata;
+       reg KBdata[11],dataCount[4]=0;
+       
+       {
+               if((old_sync ==0)&&(sync==1)){
+                       syncdata();
+               }
+               old_sync := sync;
+               if(dataCount ==12){
+                       outputByteE = 1;
+               }
+       }
+       func syncdata{
+               dataCount := dataCount + 1;
+               KBdata := {KBdata[9:0],datain};
+       }
+}
diff --git a/PS2keyboard/top.nsl b/PS2keyboard/top.nsl
new file mode 100644 (file)
index 0000000..880d793
--- /dev/null
@@ -0,0 +1,16 @@
+#include "IOrach.nsh"
+#include "keyboarddata.nsh"
+
+declare top{
+       input KBClock,KBData;
+}
+module top{
+       IOrach kbrach;
+       keyboarddata kbdata;
+       {
+               kbrach.m_clock = KBClock;
+               kbrach.datain = KBData;
+               kbdata.datain = kbrach.dataout;
+               kbdata.sync = KBData;
+       }
+}