936 Commits
Author SHA1 Message Date
jens 4666087f93 Refactored filenames 2022-09-08 16:07:39 +02:00
jens b72ba39983 - TLB enabled by default
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/branches/BRANCH_MIPS_TLB@1032 cc03376c-175c-47c8-b038-4cd826a8556b
2013-09-01 10:48:09 +00:00
jens fa38290367 Initial revision
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/branches/BRANCH_MIPS_TLB@1031 cc03376c-175c-47c8-b038-4cd826a8556b
2013-08-31 15:42:23 +00:00
jens 90b9112c5b - fixed wrong EPC for ITLB and DTLB
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/branches/BRANCH_MIPS_TLB@1030 cc03376c-175c-47c8-b038-4cd826a8556b
2013-08-31 10:49:37 +00:00
jens 007c2ade02 - put TLB queries into pipeline
- removed TLB queries from Caches
- removed output register from TLB
- cleaned up
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/branches/BRANCH_MIPS_TLB@1029 cc03376c-175c-47c8-b038-4cd826a8556b
2013-08-25 18:41:04 +00:00
jens 537b5d3fd4 - TLB enabled by default
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/branches/BRANCH_MIPS_TLB@1028 cc03376c-175c-47c8-b038-4cd826a8556b
2013-08-25 18:39:36 +00:00
jens 03f21b37d4 - added tlb_query results to pipe-stages ID and EX
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/branches/BRANCH_MIPS_TLB@1027 cc03376c-175c-47c8-b038-4cd826a8556b
2013-08-25 18:37:51 +00:00
jens 4c7100a5a7 - added headers
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/branches/BRANCH_MIPS_TLB@1026 cc03376c-175c-47c8-b038-4cd826a8556b
2013-08-25 18:00:55 +00:00
jens 41939cf290 - cleaned up
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/branches/BRANCH_MIPS_TLB@1025 cc03376c-175c-47c8-b038-4cd826a8556b
2013-08-25 17:59:12 +00:00
jens 8a6d599836 - check for unmapped hit now made on registered va
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/branches/BRANCH_MIPS_TLB@1024 cc03376c-175c-47c8-b038-4cd826a8556b
2013-08-25 17:33:35 +00:00
jens 02e35db54c - put TLB queries into pipeline
- removed TLB queries from Caches
- removed output register from TLB
- cleaned up
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/branches/BRANCH_MIPS_TLB@1023 cc03376c-175c-47c8-b038-4cd826a8556b
2013-08-25 17:04:51 +00:00
jens cb32a5aeed - reduced tpd
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/branches/BRANCH_MIPS_TLB@1022 cc03376c-175c-47c8-b038-4cd826a8556b
2013-08-25 17:01:18 +00:00
jens f5bf4fdb81 - still try to add TLB
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/branches/BRANCH_MIPS_TLB@1019 cc03376c-175c-47c8-b038-4cd826a8556b
2013-08-24 10:31:18 +00:00
jens 41513a9de0 - minor changes
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/branches/BRANCH_MIPS_TLB@1018 cc03376c-175c-47c8-b038-4cd826a8556b
2013-08-24 10:30:51 +00:00
jens feb60baa33 - renamed some pipe registers
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/branches/BRANCH_MIPS_TLB@1017 cc03376c-175c-47c8-b038-4cd826a8556b
2013-08-20 20:05:00 +00:00
jens 4ba64fdb3b - integrated ITLB and DTLB into pipeline.
TLB queries come from pipeline if generic PIPE_ITLB or  PIPE_DTLB is true. Cache query is then disabled.
  If generic PIPE_ITLB or  PIPE_DTLB set to false queries come from cache.
  Piped TLB queries are piped translations with latency of two clocks. Piped translation allow physically indexed and physically tagged caches
- reworked PC logic
- prepared for individual BCUs in EX, MEM and WB stage
- changed LTS and LTU generation in ALU

Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/branches/BRANCH_MIPS_TLB@1016 cc03376c-175c-47c8-b038-4cd826a8556b
2013-08-18 19:03:43 +00:00
jens 81698e2391 - integrated ITLB and DTLB into pipeline.
TLB queries come from pipeline if generic PIPE_ITLB or  PIPE_DTLB is true. Cache query is then disabled.
  If generic PIPE_ITLB or  PIPE_DTLB set to false queries come from cache.
  Piped TLB queries are piped translations with latency of two clocks. Piped translation allow physically indexed and physically tagged caches
- reworked PC logic
- prepared for individual BCUs in EX, MEM and WB stage
- changed LTS and LTU generation in ALU

Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/branches/BRANCH_MIPS_TLB@1015 cc03376c-175c-47c8-b038-4cd826a8556b
2013-08-18 18:56:42 +00:00
jens 6c7780bee9 - minor changes
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/branches/BRANCH_MIPS_TLB@1014 cc03376c-175c-47c8-b038-4cd826a8556b
2013-08-18 09:25:24 +00:00
jens a927b88db3 - paths adjusted
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/branches/BRANCH_MIPS_TLB@1013 cc03376c-175c-47c8-b038-4cd826a8556b
2013-08-18 09:07:29 +00:00
jens a3b0766258 - minor changes
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/branches/BRANCH_MIPS_TLB@1012 cc03376c-175c-47c8-b038-4cd826a8556b
2013-08-18 09:07:16 +00:00
jens e59d0f2904 - paths adjusted
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/branches/BRANCH_MIPS_TLB@1011 cc03376c-175c-47c8-b038-4cd826a8556b
2013-08-18 08:44:25 +00:00
jens e5a31bdf7c Initial revision
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/branches/BRANCH_MIPS_TLB@1010 cc03376c-175c-47c8-b038-4cd826a8556b
2013-08-18 08:43:09 +00:00
jens 6dfac747b6 Branch entry:
- added TLB stuff
- slightly redesigned
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/branches/BRANCH_MIPS_TLB@1009 cc03376c-175c-47c8-b038-4cd826a8556b
2013-08-18 08:32:08 +00:00
jens 9870f78e51 This commit was manufactured by cvs2svn to create branch 'BRANCH_MIPS_TLB'.
git-svn-id: http://moon:8086/svn/vhdl/branches/BRANCH_MIPS_TLB@1007 cc03376c-175c-47c8-b038-4cd826a8556b
2013-08-18 08:15:42 +00:00
jens eacfe7f9d2 Branch entry:
- added TLB stuff
- slightly redesigned
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/branches/BRANCH_MIPS_TLB@1003 cc03376c-175c-47c8-b038-4cd826a8556b
2013-08-18 08:03:26 +00:00
jens 04bb65792b Initial revision
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/branches/BRANCH_MIPS_TLB@1002 cc03376c-175c-47c8-b038-4cd826a8556b
2013-08-18 08:02:23 +00:00
jens 06875daf11 This commit was manufactured by cvs2svn to create branch 'BRANCH_MIPS_TLB'.
git-svn-id: http://moon:8086/svn/vhdl/branches/BRANCH_MIPS_TLB@1000 cc03376c-175c-47c8-b038-4cd826a8556b
2013-08-18 07:07:28 +00:00
jens c0bf39885e - debug output is now record
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@999 cc03376c-175c-47c8-b038-4cd826a8556b
2013-08-18 07:07:27 +00:00
jens ae123fadc7 - change instructionamesfor nop and illegal
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@997 cc03376c-175c-47c8-b038-4cd826a8556b
2013-08-10 17:24:44 +00:00
jens dcea9c36b7 - Quick and dirty hack:
avoid buscycle to finish even if data available,
  caused by latency of async-FIFO empty flag

Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@996 cc03376c-175c-47c8-b038-4cd826a8556b
2013-08-04 17:58:37 +00:00
jens daeae0edba - m�nor changes
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@995 cc03376c-175c-47c8-b038-4cd826a8556b
2013-08-03 19:31:19 +00:00
jens 802ac54fdc - added MMU
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@994 cc03376c-175c-47c8-b038-4cd826a8556b
2013-07-28 19:54:13 +00:00
jens e1c497beab - added map for translated MIPS
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@993 cc03376c-175c-47c8-b038-4cd826a8556b
2013-07-28 19:53:59 +00:00
jens c40a774db8 - modified uart_status in simulation mode. Good for debugging.
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@992 cc03376c-175c-47c8-b038-4cd826a8556b
2013-07-28 19:53:15 +00:00
jens 2f047f8efb - m�nor changes
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@991 cc03376c-175c-47c8-b038-4cd826a8556b
2013-07-28 19:52:26 +00:00
jens 8ca2e8128d Initial revision
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@990 cc03376c-175c-47c8-b038-4cd826a8556b
2013-07-28 19:52:19 +00:00
jens aef329e702 - added WE_I for rom
- registered addr instead of registered output
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@989 cc03376c-175c-47c8-b038-4cd826a8556b
2013-07-28 19:51:40 +00:00
jens 2a83979a5b - added WE_I for rom
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@988 cc03376c-175c-47c8-b038-4cd826a8556b
2013-07-28 19:51:04 +00:00
jens 191646cc73 - reg_uart_tx is also written in simulation mode. Good for debugging.
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@987 cc03376c-175c-47c8-b038-4cd826a8556b
2013-07-28 17:00:21 +00:00
jens cd2640e9c6 Initial revision
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@986 cc03376c-175c-47c8-b038-4cd826a8556b
2013-07-24 18:13:16 +00:00
jens e48ed8f595 Initial revision
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@985 cc03376c-175c-47c8-b038-4cd826a8556b
2013-07-21 09:21:30 +00:00
jens 8054829fcc - minor bugfix with read counter
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@984 cc03376c-175c-47c8-b038-4cd826a8556b
2013-07-21 09:21:17 +00:00
jens 9ff2d32370 - read_counter now decremented, if local side really has read
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@983 cc03376c-175c-47c8-b038-4cd826a8556b
2013-07-21 09:10:13 +00:00
jens 1926d23b44 - avoid of undefined data in forwarding logic during simulation.
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@982 cc03376c-175c-47c8-b038-4cd826a8556b
2013-07-20 18:41:32 +00:00
jens f002777772 - cleaned up.
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@981 cc03376c-175c-47c8-b038-4cd826a8556b
2013-07-20 18:39:46 +00:00
jens c1042cfa51 - m�nor changes
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@980 cc03376c-175c-47c8-b038-4cd826a8556b
2013-07-20 09:55:55 +00:00
jens a836d35ee1 - made ram sizable
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@979 cc03376c-175c-47c8-b038-4cd826a8556b
2013-07-20 09:53:34 +00:00
jens a43bcf23af - uses now new generic DPRAMs
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@978 cc03376c-175c-47c8-b038-4cd826a8556b
2013-07-13 07:06:30 +00:00
jens 0253fc426d - added DMA_START and DMA_END strobe signals
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@977 cc03376c-175c-47c8-b038-4cd826a8556b
2013-05-28 11:23:23 +00:00
jens 27021a571d - cleaned up.
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@976 cc03376c-175c-47c8-b038-4cd826a8556b
2013-05-28 10:18:33 +00:00
jens f4a34e386e Initial revision
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@975 cc03376c-175c-47c8-b038-4cd826a8556b
2013-05-28 10:18:02 +00:00
jens 8b1c6d706e - m�nor changes
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@974 cc03376c-175c-47c8-b038-4cd826a8556b
2013-05-28 10:13:26 +00:00
jens e138bc1259 - m�nor changes
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@973 cc03376c-175c-47c8-b038-4cd826a8556b
2013-05-27 21:31:22 +00:00
jens 6147fe66e3 - added header
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@972 cc03376c-175c-47c8-b038-4cd826a8556b
2013-05-27 11:17:51 +00:00
jens 285ebe2795 Initial revision
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@971 cc03376c-175c-47c8-b038-4cd826a8556b
2013-05-27 11:16:41 +00:00
jens daf5a55788 -separate write FIFO
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@970 cc03376c-175c-47c8-b038-4cd826a8556b
2013-05-27 11:16:30 +00:00
jens 9f939c1e85 Initial revision
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@969 cc03376c-175c-47c8-b038-4cd826a8556b
2013-05-25 16:55:29 +00:00
jens 697dc4f0d3 - cleaned up
- reorderd registers
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@968 cc03376c-175c-47c8-b038-4cd826a8556b
2013-05-12 17:03:18 +00:00
jens bd6adf0ff7 - increased CMD-FIFO depth to 256 entries
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@967 cc03376c-175c-47c8-b038-4cd826a8556b
2013-05-11 17:55:35 +00:00
jens 9afbdcb353 - m�nor changes
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@966 cc03376c-175c-47c8-b038-4cd826a8556b
2013-05-11 14:16:02 +00:00
jens ba9fb123d3 Initial revision
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@965 cc03376c-175c-47c8-b038-4cd826a8556b
2013-05-11 14:15:49 +00:00
jens 485d5bcd82 - deleted VGA-align-stuff. Never worked.
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@964 cc03376c-175c-47c8-b038-4cd826a8556b
2013-05-11 14:15:30 +00:00
jens 5bdfc99bc6 - use rom file blittertest_tb
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@963 cc03376c-175c-47c8-b038-4cd826a8556b
2013-05-11 14:14:59 +00:00
jens e3e4d6bf01 - increased VGA scanline FIFO
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@962 cc03376c-175c-47c8-b038-4cd826a8556b
2013-05-11 14:14:26 +00:00
jens 41978bb08c - Bugfix: Registers not correctly update during read
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@961 cc03376c-175c-47c8-b038-4cd826a8556b
2013-05-11 14:13:44 +00:00
jens f0093103fa - added BLIT command FIFO
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@960 cc03376c-175c-47c8-b038-4cd826a8556b
2013-05-06 21:52:44 +00:00
jens a2a1d6f5b9 - cleaned up. Not tidy yet.
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@959 cc03376c-175c-47c8-b038-4cd826a8556b
2013-05-05 10:42:17 +00:00
jens e21b4d5e81 - deleted VGA-align-stuff. Never worked.
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@958 cc03376c-175c-47c8-b038-4cd826a8556b
2013-05-05 09:50:53 +00:00
jens 05e18be4e7 - Blitter now works correctly. Supports non-aligned load/store.
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@957 cc03376c-175c-47c8-b038-4cd826a8556b
2013-05-05 09:49:56 +00:00
jens 77e58cfbde Initial revision
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@956 cc03376c-175c-47c8-b038-4cd826a8556b
2013-04-27 17:46:49 +00:00
jens a6a659904b - weird blitter stuff
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@955 cc03376c-175c-47c8-b038-4cd826a8556b
2013-04-27 17:46:26 +00:00
jens 2e8a574d88 - m�nor changes
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@954 cc03376c-175c-47c8-b038-4cd826a8556b
2013-04-27 17:45:02 +00:00
jens 81067ffa84 renamed shifter to align_shifter
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@953 cc03376c-175c-47c8-b038-4cd826a8556b
2013-04-27 17:44:37 +00:00
jens c6c676d89b - uses now new generic DPRAMs
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@952 cc03376c-175c-47c8-b038-4cd826a8556b
2013-04-27 13:59:13 +00:00
jens 57f8626d86 CLOCKGEN: cpu_clock is now variable. SYS_CLK is fixed to input frequency
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@951 cc03376c-175c-47c8-b038-4cd826a8556b
2013-04-27 13:39:29 +00:00
jens da67d66447 Initial revision
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@950 cc03376c-175c-47c8-b038-4cd826a8556b
2013-04-27 10:53:09 +00:00
jens 17aaaea4ab get XILINX path from environment
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@949 cc03376c-175c-47c8-b038-4cd826a8556b
2013-04-27 10:52:52 +00:00
jens e349fbcecf - SDR-Clock now derived from clk_in, instead of sys_clk_fx
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@948 cc03376c-175c-47c8-b038-4cd826a8556b
2013-04-26 10:42:07 +00:00
jens 2361b4a440 - m�nor changes
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@947 cc03376c-175c-47c8-b038-4cd826a8556b
2013-02-09 10:49:51 +00:00
jens 4ffe6063ba - uses now new generic DPRAMs
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@946 cc03376c-175c-47c8-b038-4cd826a8556b
2013-02-09 10:45:59 +00:00
jens c36489a1d3 - use registered address DPRAM
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@945 cc03376c-175c-47c8-b038-4cd826a8556b
2013-02-09 10:42:49 +00:00
jens 7b972d0084 - FIFOs only use registered output DPRAMs
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@944 cc03376c-175c-47c8-b038-4cd826a8556b
2013-02-09 10:42:07 +00:00
jens 61d9104fb2 Initial revision
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@943 cc03376c-175c-47c8-b038-4cd826a8556b
2013-02-09 09:27:21 +00:00
jens 280db0f521 - uses now new generic DPRAMs
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@942 cc03376c-175c-47c8-b038-4cd826a8556b
2013-02-09 09:26:12 +00:00
jens bf4ba346c0 - uses now new generic DPRAMs
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@941 cc03376c-175c-47c8-b038-4cd826a8556b
2013-02-09 09:17:40 +00:00
jens c4bbe02cdc removed
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@940 cc03376c-175c-47c8-b038-4cd826a8556b
2013-02-08 10:47:09 +00:00
jens 026c442fce Initial revision
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@939 cc03376c-175c-47c8-b038-4cd826a8556b
2013-02-07 14:50:03 +00:00
jens 0d10a1c1c6 Initial revision
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@938 cc03376c-175c-47c8-b038-4cd826a8556b
2013-02-07 14:19:15 +00:00
jens 6951fea497 deleted
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@937 cc03376c-175c-47c8-b038-4cd826a8556b
2011-07-24 08:34:13 +00:00
jens 181ba51895 Initial version
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@936 cc03376c-175c-47c8-b038-4cd826a8556b
2011-07-24 08:32:22 +00:00
jens faa81b57e9 Initial version
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@933 cc03376c-175c-47c8-b038-4cd826a8556b
2011-07-24 08:18:45 +00:00
jens fec1234493 deleted
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@932 cc03376c-175c-47c8-b038-4cd826a8556b
2011-07-24 08:17:27 +00:00
jens d56aec5d03 Initial version
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@931 cc03376c-175c-47c8-b038-4cd826a8556b
2011-07-24 07:48:35 +00:00
jens 921b1e8876 - update
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@930 cc03376c-175c-47c8-b038-4cd826a8556b
2011-07-24 07:36:30 +00:00
jens 127ed5b3f7 Initial version
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@929 cc03376c-175c-47c8-b038-4cd826a8556b
2011-07-24 07:35:37 +00:00
jens 840fcb7de1 - added async FIFO-stuff for R13
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@928 cc03376c-175c-47c8-b038-4cd826a8556b
2011-07-24 07:05:18 +00:00
jens 4a1d1df404 - added dedicated cpu_clk
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@927 cc03376c-175c-47c8-b038-4cd826a8556b
2011-07-24 07:04:09 +00:00
jens 03c23a0271 Initial version
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@926 cc03376c-175c-47c8-b038-4cd826a8556b
2011-07-24 06:56:28 +00:00
jens 6cb8c135e2 - added async FIFO stuff for R13
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@925 cc03376c-175c-47c8-b038-4cd826a8556b
2011-07-23 17:07:45 +00:00
jens cb503294da - removed async FIFO stuff for R12
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@924 cc03376c-175c-47c8-b038-4cd826a8556b
2011-07-23 17:07:09 +00:00
jens 2858222d97 Initial version
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@923 cc03376c-175c-47c8-b038-4cd826a8556b
2011-07-23 17:01:10 +00:00
jens a2f631f4de - removed signal 'irq_out'
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@922 cc03376c-175c-47c8-b038-4cd826a8556b
2011-06-25 15:28:08 +00:00
jens f265661633 - removed pushd and popd from control lines. Reduce by 2.
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@921 cc03376c-175c-47c8-b038-4cd826a8556b
2011-06-25 15:09:09 +00:00
jens 5430521f4f - chipreg was not bound
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@920 cc03376c-175c-47c8-b038-4cd826a8556b
2011-06-25 06:47:21 +00:00
jens 97a19e0eb7 Initial version
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@919 cc03376c-175c-47c8-b038-4cd826a8556b
2011-06-25 06:37:42 +00:00
jens 5a3e859d59 - made it run
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@918 cc03376c-175c-47c8-b038-4cd826a8556b
2011-06-25 06:37:26 +00:00
jens e28d864e40 - added bus input FIFO
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@917 cc03376c-175c-47c8-b038-4cd826a8556b
2010-05-17 08:33:50 +00:00
jens ec301f5710 - added procedures for register R/W
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@916 cc03376c-175c-47c8-b038-4cd826a8556b
2010-05-16 12:24:07 +00:00
jens 26a0a30fdc - fixed bus-timeout for nx=0 and ny /= 0
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@915 cc03376c-175c-47c8-b038-4cd826a8556b
2010-05-15 23:43:34 +00:00
jens 66514fbf7c cleaned up
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@914 cc03376c-175c-47c8-b038-4cd826a8556b
2010-05-15 16:00:13 +00:00
jens dff1254bd9 fixed unaligned src blitter bug
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@913 cc03376c-175c-47c8-b038-4cd826a8556b
2010-05-15 15:05:35 +00:00
jens 5c37f43fcb Inital version
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@912 cc03376c-175c-47c8-b038-4cd826a8556b
2010-05-14 17:18:43 +00:00
jens c7f8eea244 - added byte alignment support for blitter
- added constant color blitting
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@911 cc03376c-175c-47c8-b038-4cd826a8556b
2010-05-14 17:18:17 +00:00
jens 197e65fc28 - increased window for RX/TX-Data to 32 kByte. Offset is at 0x8000..0x8FFC
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@909 cc03376c-175c-47c8-b038-4cd826a8556b
2010-04-10 12:04:18 +00:00
jens 0af5d4e58c - reserved 32 byte window for RX/TX-Data at offset 0x20..0x3C
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@908 cc03376c-175c-47c8-b038-4cd826a8556b
2010-04-10 10:15:56 +00:00
jens b5feee8447 - mapped emac additionally to cached area at 0x10000000
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@907 cc03376c-175c-47c8-b038-4cd826a8556b
2010-04-10 10:15:00 +00:00
jens 80f75ce136 - added crc32 for emac
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@906 cc03376c-175c-47c8-b038-4cd826a8556b
2010-04-10 08:28:36 +00:00
jens 17e00a420a - minor changes
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@904 cc03376c-175c-47c8-b038-4cd826a8556b
2010-04-10 07:43:01 +00:00
jens 3e81496d67 - different IFG for gigabit and 10/100mbps
- combines MII-FIFO read delay with IFG-Function
- removed IFG-counter
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@903 cc03376c-175c-47c8-b038-4cd826a8556b
2010-04-10 07:41:57 +00:00
jens cd4b4bb99a - changed behaviour of 'crc32_vld'
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@902 cc03376c-175c-47c8-b038-4cd826a8556b
2010-04-10 07:25:32 +00:00
jens d51a303d9c - added emac
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@901 cc03376c-175c-47c8-b038-4cd826a8556b
2010-04-09 10:40:27 +00:00
jens 64ebb3af9e - minor changes
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@899 cc03376c-175c-47c8-b038-4cd826a8556b
2010-04-09 10:36:01 +00:00
jens 073acdd2ff - packet size reduced by 4 if fcs-check is enabled
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@898 cc03376c-175c-47c8-b038-4cd826a8556b
2010-04-09 10:15:15 +00:00
jens eba2e4e3b9 - minor changes
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@897 cc03376c-175c-47c8-b038-4cd826a8556b
2010-04-09 09:14:01 +00:00
jens 7f6678d85a - added pin fcs_gen_en to append fcs for packet generator
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@896 cc03376c-175c-47c8-b038-4cd826a8556b
2010-04-09 09:01:10 +00:00
jens e7f4a5642a - added FCS-check (CRC32)
- added FCS check enable
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@895 cc03376c-175c-47c8-b038-4cd826a8556b
2010-04-09 09:00:38 +00:00
jens 330b7e019e - added FCS generation enable
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@894 cc03376c-175c-47c8-b038-4cd826a8556b
2010-04-09 08:59:44 +00:00
jens 9991abfebf - added FCS generation enable for TX
- added FCS check enable for RX
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@893 cc03376c-175c-47c8-b038-4cd826a8556b
2010-04-09 08:59:06 +00:00
jens 5fbcc211b9 - added generic for initial value
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@892 cc03376c-175c-47c8-b038-4cd826a8556b
2010-04-09 08:46:55 +00:00
jens 17bcf20d9d - added pin fcs_gen_en to append fcs
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@891 cc03376c-175c-47c8-b038-4cd826a8556b
2010-04-09 08:46:41 +00:00
jens 6936064c01 - minor changes
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@890 cc03376c-175c-47c8-b038-4cd826a8556b
2010-04-08 19:13:34 +00:00
jens a23e3325c9 Inital version
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@889 cc03376c-175c-47c8-b038-4cd826a8556b
2010-04-08 19:13:08 +00:00
jens 964b08a53c - added MII-FIFO read delay. To avoid tx_en-gaps during FCS calculation
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@888 cc03376c-175c-47c8-b038-4cd826a8556b
2010-04-08 19:06:11 +00:00
jens 11a46a6ef8 - never ending SIPO story
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@887 cc03376c-175c-47c8-b038-4cd826a8556b
2010-04-08 19:04:50 +00:00
jens 43f11d43a9 - prpared for testing of 100mbps and 1000mbps
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@886 cc03376c-175c-47c8-b038-4cd826a8556b
2010-04-08 19:04:39 +00:00
jens 0737dc8c74 - added gigabit_en pin
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@885 cc03376c-175c-47c8-b038-4cd826a8556b
2010-04-08 19:03:50 +00:00
jens e40bb138ba - added FCS-calculation (CRC32)
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@884 cc03376c-175c-47c8-b038-4cd826a8556b
2010-04-08 16:53:16 +00:00
jens c00c254636 - never ending PISO story
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@883 cc03376c-175c-47c8-b038-4cd826a8556b
2010-04-08 16:52:47 +00:00
jens 1abe64b3b4 Inital version
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@882 cc03376c-175c-47c8-b038-4cd826a8556b
2010-04-08 15:44:55 +00:00
jens 76eb2dfe32 - cleaned up
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@881 cc03376c-175c-47c8-b038-4cd826a8556b
2010-04-08 08:41:47 +00:00
jens 68d0a4cf50 - renamed
git-svn-id: http://moon:8086/svn/vhdl/trunk@880 cc03376c-175c-47c8-b038-4cd826a8556b
2010-04-08 08:33:24 +00:00
jens 3faea6675b - renamed
git-svn-id: http://moon:8086/svn/vhdl/trunk@879 cc03376c-175c-47c8-b038-4cd826a8556b
2010-04-08 08:33:23 +00:00
jens 37d4fe76dc - cleaned up
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@878 cc03376c-175c-47c8-b038-4cd826a8556b
2010-04-08 08:30:12 +00:00
jens 328cb7309e - cleaned up
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@877 cc03376c-175c-47c8-b038-4cd826a8556b
2010-04-08 08:30:11 +00:00
jens d7e039dc77 - cleaned up
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@876 cc03376c-175c-47c8-b038-4cd826a8556b
2010-04-08 08:30:10 +00:00
jens 59da541fca - bugfix: interframe gap counter was not effective
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@875 cc03376c-175c-47c8-b038-4cd826a8556b
2010-04-07 21:24:42 +00:00
jens 1f1d858f18 - minor changes
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@873 cc03376c-175c-47c8-b038-4cd826a8556b
2010-04-07 18:44:42 +00:00
jens 3a58fbb7af - simplified xfer-fsm, preamble, sipo32, etc
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@872 cc03376c-175c-47c8-b038-4cd826a8556b
2010-04-07 17:55:26 +00:00
jens 4b88e122f2 - fixed bug: capturing without din_en
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@871 cc03376c-175c-47c8-b038-4cd826a8556b
2010-04-07 17:54:26 +00:00
jens 615b776ead - added MII loopback
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@870 cc03376c-175c-47c8-b038-4cd826a8556b
2010-04-07 15:29:20 +00:00
jens edc389931a - minor changes
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@869 cc03376c-175c-47c8-b038-4cd826a8556b
2010-04-07 15:28:49 +00:00
jens cfa1a3f8a2 - separate RX/TX status and size register
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@868 cc03376c-175c-47c8-b038-4cd826a8556b
2010-04-07 15:28:23 +00:00
jens 433ff23c41 - removed rx_er-flag
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@867 cc03376c-175c-47c8-b038-4cd826a8556b
2010-04-07 15:27:43 +00:00
jens 6cdd8d566b - tied mii_tx_er to 0
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@866 cc03376c-175c-47c8-b038-4cd826a8556b
2010-04-07 15:27:18 +00:00
jens 063019e23e - added byte_count reset
- generate ram_limit in sysclk-domain. Synced to MII-Clk domain
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@865 cc03376c-175c-47c8-b038-4cd826a8556b
2010-04-07 15:26:45 +00:00
jens 668ab68b8b - minor changes
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@864 cc03376c-175c-47c8-b038-4cd826a8556b
2010-04-07 11:20:44 +00:00
jens bb41db0f76 - removed 'tx_err' from register flags
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@863 cc03376c-175c-47c8-b038-4cd826a8556b
2010-04-07 11:20:19 +00:00
jens c3b554ffc3 - packet generator now uses emac_tx as transmitter
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@862 cc03376c-175c-47c8-b038-4cd826a8556b
2010-04-07 09:56:49 +00:00
jens b3cda75c60 - minor changes
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@861 cc03376c-175c-47c8-b038-4cd826a8556b
2010-04-06 18:30:46 +00:00
jens d1e30cfa5c - added gigabit--mode
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@860 cc03376c-175c-47c8-b038-4cd826a8556b
2010-04-06 18:30:31 +00:00
jens d7b6040c38 - cleaned up
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@859 cc03376c-175c-47c8-b038-4cd826a8556b
2010-04-06 15:35:30 +00:00
jens 39c15ef86c - simplified: removed MII-FIFO. Connected RAM to MII-domain
- cleaned up
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@858 cc03376c-175c-47c8-b038-4cd826a8556b
2010-04-06 15:35:21 +00:00
jens 8f283ae097 - simplified: removed MII-FIFO. Connected RAM to MII-domain
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@857 cc03376c-175c-47c8-b038-4cd826a8556b
2010-04-06 13:29:27 +00:00
jens bd64cab371 - minor changes
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@855 cc03376c-175c-47c8-b038-4cd826a8556b
2010-04-04 09:56:37 +00:00
jens c6e0de57ec - minor fix
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@854 cc03376c-175c-47c8-b038-4cd826a8556b
2010-04-04 09:55:51 +00:00
jens e8deef86a6 - added preamble genration
- simplified design
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@853 cc03376c-175c-47c8-b038-4cd826a8556b
2010-04-04 09:55:22 +00:00
jens 4d41635f19 - added MAC own address register
- added MAC check and promiscious mode
- added new flags
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@852 cc03376c-175c-47c8-b038-4cd826a8556b
2010-04-04 09:54:27 +00:00
jens d7a1ee94e6 - added preamble sync and preamble stripping
- added MAC own address register
- added MAC check and promiscious mode
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@851 cc03376c-175c-47c8-b038-4cd826a8556b
2010-04-04 09:53:55 +00:00
jens bd90e641cf - added ethernet MAC
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@850 cc03376c-175c-47c8-b038-4cd826a8556b
2010-03-30 10:22:46 +00:00
jens 25b57a30fe - slightly detuned MII_CLK for more realism
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@848 cc03376c-175c-47c8-b038-4cd826a8556b
2010-03-30 10:15:24 +00:00
jens ed9601c6aa - synced ifg_rdy to sys_clk
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@847 cc03376c-175c-47c8-b038-4cd826a8556b
2010-03-30 10:02:39 +00:00
jens d7c023950b - added ethernet MAC
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@846 cc03376c-175c-47c8-b038-4cd826a8556b
2010-03-29 10:11:02 +00:00
jens a6ba2eeec5 - added ethernet MAC
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@845 cc03376c-175c-47c8-b038-4cd826a8556b
2010-03-28 23:29:27 +00:00
jens 904ec64a52 - assigned INT_O
- register interface still under construction
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@844 cc03376c-175c-47c8-b038-4cd826a8556b
2010-03-28 23:27:06 +00:00
jens 4f1f4ca77b - more realistic timing of J-Bus Master
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@843 cc03376c-175c-47c8-b038-4cd826a8556b
2010-03-28 22:32:27 +00:00
jens 67136eeedf - improved allocation stuff
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@842 cc03376c-175c-47c8-b038-4cd826a8556b
2010-03-28 21:48:45 +00:00
jens 3d90300b81 - added pkt_armed register bit (ready-to-write-bit)
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@841 cc03376c-175c-47c8-b038-4cd826a8556b
2010-03-28 20:00:36 +00:00
jens f6b662274c - reassigned register bits
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@840 cc03376c-175c-47c8-b038-4cd826a8556b
2010-03-28 19:59:36 +00:00
jens b2230a8afb - minor fix
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@839 cc03376c-175c-47c8-b038-4cd826a8556b
2010-03-28 17:05:54 +00:00
jens 2ca53be113 - added reset register bit for RX/TX
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@838 cc03376c-175c-47c8-b038-4cd826a8556b
2010-03-28 17:05:39 +00:00
jens 89b2cdc6f9 - improved IFG counter
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@837 cc03376c-175c-47c8-b038-4cd826a8556b
2010-03-28 17:05:09 +00:00
jens 43085119b7 - added reset gen
- improved IFG counter
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@836 cc03376c-175c-47c8-b038-4cd826a8556b
2010-03-28 17:05:00 +00:00
jens 19d5dc19d6 - added xfer_info FIFO with byte and word counter information
- added reset generator
- cleaned up
- reception is now working properly
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@835 cc03376c-175c-47c8-b038-4cd826a8556b
2010-03-28 17:04:28 +00:00
jens 6118008f77 - added packet generator
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@834 cc03376c-175c-47c8-b038-4cd826a8556b
2010-03-28 08:29:04 +00:00
jens aede06ea9e Initial version
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@833 cc03376c-175c-47c8-b038-4cd826a8556b
2010-03-28 08:28:48 +00:00
jens 6746955337 - added transfer dropstate in case of RAM full
- registered ctrl_out.pkt_lost. Cleared on pkt_free
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@832 cc03376c-175c-47c8-b038-4cd826a8556b
2010-03-28 08:28:29 +00:00
jens 34de6ae03e - fixed retrigger issue
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@831 cc03376c-175c-47c8-b038-4cd826a8556b
2010-03-28 08:27:21 +00:00
jens 2989bb688f - renamed signal names
- receiver commands:
  packet request : sets fill pointer to next packet from queue
  packet free       : removes packet from queue
- added pkt_done flag (TX idle)
- transmitter commands:
  packet alloc       : request ram for packet
  packet commit   : sends packet

Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@830 cc03376c-175c-47c8-b038-4cd826a8556b
2010-03-26 09:45:44 +00:00
jens 38a95c85dd - renamed signal names
- added pkt_done flag (TX idle)
- transmitter commands:
  packet alloc       : request ram for packet
  packet commit   : sends packet

Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@829 cc03376c-175c-47c8-b038-4cd826a8556b
2010-03-26 09:44:59 +00:00
jens 03cbf45996 - renamed signal names
- receiver commands:
  packet request : sets fill pointer to next packet from queue
  packet free       : removes packet from queue
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@828 cc03376c-175c-47c8-b038-4cd826a8556b
2010-03-26 09:43:23 +00:00
jens 7fd7987056 - added ram overflow bit
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@827 cc03376c-175c-47c8-b038-4cd826a8556b
2010-03-25 22:37:15 +00:00
jens 08e85b7e8f - modified input rdy logic to avoid multi cycle ready after idle
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@826 cc03376c-175c-47c8-b038-4cd826a8556b
2010-03-25 21:34:10 +00:00
jens 7c6a19b078 - added data read counter
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@825 cc03376c-175c-47c8-b038-4cd826a8556b
2010-03-25 21:11:37 +00:00
jens f602a4baa7 - minor changes in register interface
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@824 cc03376c-175c-47c8-b038-4cd826a8556b
2010-03-25 21:11:10 +00:00
jens c0291407fe - removed data_vld from tx_ctrl_in and rx_ctrl_out
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@823 cc03376c-175c-47c8-b038-4cd826a8556b
2010-03-25 21:10:36 +00:00
jens ebdb4e1e2c - added din_vld which corressponds to din
- fixed wrong byte enables for first PISO (MSB_FIRST
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@822 cc03376c-175c-47c8-b038-4cd826a8556b
2010-03-25 21:09:59 +00:00
jens 0554714b52 - added dout_vld which corressponds to dout
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@821 cc03376c-175c-47c8-b038-4cd826a8556b
2010-03-25 21:08:50 +00:00
jens e8b6c8efdb - TX-params are set via ctrl_in directly from regsiter interface.
No parameter set via din anymore
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@820 cc03376c-175c-47c8-b038-4cd826a8556b
2010-03-25 19:56:53 +00:00
jens 832c1c8a33 - minor changes in register interface
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@819 cc03376c-175c-47c8-b038-4cd826a8556b
2010-03-25 09:34:27 +00:00
jens 3b014c19ca - modifications for improved SIPOs and PISOs
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@818 cc03376c-175c-47c8-b038-4cd826a8556b
2010-03-25 09:34:01 +00:00
jens 80f57311e4 - redesigned :
- added data input register
  - PISOs can be cascaded


Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@817 cc03376c-175c-47c8-b038-4cd826a8556b
2010-03-25 09:33:02 +00:00
jens 2978ddd09a - bugfix: LSB_FIRST was not working
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@816 cc03376c-175c-47c8-b038-4cd826a8556b
2010-03-25 09:31:43 +00:00
jens 869a0bd0ef - redesigned :
- din_en means stream is active
  - din_vld means shift enable
  - there also exist output versions dout_en and  dout_vld. Thus, SIPOs can be cascaded


git-svn-id: http://moon:8086/svn/vhdl/trunk@815 cc03376c-175c-47c8-b038-4cd826a8556b
2010-03-24 11:13:46 +00:00
jens d99d8e2b44 Minor changes
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@814 cc03376c-175c-47c8-b038-4cd826a8556b
2010-03-23 11:41:32 +00:00
jens 4057a7ba43 Minor changes
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@813 cc03376c-175c-47c8-b038-4cd826a8556b
2010-03-23 11:39:43 +00:00
jens 737df176f1 Initial version
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@812 cc03376c-175c-47c8-b038-4cd826a8556b
2010-03-23 11:34:56 +00:00
jens cd285df8e8 - added command fifo for xfer unit
- completed first version of receiver
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@811 cc03376c-175c-47c8-b038-4cd826a8556b
2010-03-23 11:34:28 +00:00
jens c3c2cdfe2b - added MIN/MAX functions for integers
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@810 cc03376c-175c-47c8-b038-4cd826a8556b
2010-03-22 07:25:40 +00:00
jens 84fa08326f Initial version
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@809 cc03376c-175c-47c8-b038-4cd826a8556b
2010-03-21 21:23:50 +00:00
jens 433676de7d Minor changes
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@808 cc03376c-175c-47c8-b038-4cd826a8556b
2010-03-21 15:17:09 +00:00
jens 8960bc52e7 - allow reallocation during tx-fill
tx is re-armed and already written data is discarded.
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@807 cc03376c-175c-47c8-b038-4cd826a8556b
2010-03-21 15:12:09 +00:00
jens 88bd1e16d9 - added TX_RAM_SIZE generic
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@806 cc03376c-175c-47c8-b038-4cd826a8556b
2010-03-21 14:49:51 +00:00
jens 10a5d17015 - added transmitter part with memory allocation
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@805 cc03376c-175c-47c8-b038-4cd826a8556b
2010-03-21 14:41:09 +00:00
jens 5f29361ee4 - added vld_pipe flush during reset
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@804 cc03376c-175c-47c8-b038-4cd826a8556b
2010-03-21 11:35:33 +00:00
jens a799fffaa7 - renamed dout_en to dout_vld
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@803 cc03376c-175c-47c8-b038-4cd826a8556b
2010-03-19 10:22:16 +00:00
jens 1e2700f265 Initial version
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@802 cc03376c-175c-47c8-b038-4cd826a8556b
2010-03-19 10:15:55 +00:00
jens 421c961df5 - added byte enables
- improvements for better generality
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@801 cc03376c-175c-47c8-b038-4cd826a8556b
2010-03-19 10:15:42 +00:00
jens 6ce6b1e4bc Initial version
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@800 cc03376c-175c-47c8-b038-4cd826a8556b
2010-03-18 22:01:10 +00:00
jens 6409d43d38 - added integer shift amount (sa)
with positive value for left shift and negaitve values for right shift
- removed shift_left port
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@799 cc03376c-175c-47c8-b038-4cd826a8556b
2010-03-18 20:18:25 +00:00
jens e84c9c287e Initial version
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@798 cc03376c-175c-47c8-b038-4cd826a8556b
2010-03-18 19:50:28 +00:00
jens d9f3628dd7 update
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@797 cc03376c-175c-47c8-b038-4cd826a8556b
2010-03-16 21:00:56 +00:00
jens afcfc8c13a Initial version
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@796 cc03376c-175c-47c8-b038-4cd826a8556b
2010-03-16 21:00:16 +00:00
jens 2369919996 - added f_sysclk generic
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@795 cc03376c-175c-47c8-b038-4cd826a8556b
2010-03-16 20:59:36 +00:00
jens 47e15b9feb Initial version
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@794 cc03376c-175c-47c8-b038-4cd826a8556b
2010-03-14 18:51:18 +00:00
jens 1a4f894996 - increased revision to R13
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@793 cc03376c-175c-47c8-b038-4cd826a8556b
2010-03-13 16:49:12 +00:00
jens fcce3dcf32 - made GPIO 0 bidirectional (added GPIO_DIR register)
- removed GPIO 1
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@792 cc03376c-175c-47c8-b038-4cd826a8556b
2010-03-13 16:46:21 +00:00
jens db662f411f Initial version
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@791 cc03376c-175c-47c8-b038-4cd826a8556b
2010-03-13 14:43:48 +00:00
jens 191af92d47 Initial version
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@790 cc03376c-175c-47c8-b038-4cd826a8556b
2010-03-13 14:13:53 +00:00
jens ab41a4f80f Initial version
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@789 cc03376c-175c-47c8-b038-4cd826a8556b
2010-03-13 14:05:15 +00:00
jens 9ac3c738db Initial version
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@788 cc03376c-175c-47c8-b038-4cd826a8556b
2010-03-13 13:54:27 +00:00
jens 8750901468 - improved register update
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@787 cc03376c-175c-47c8-b038-4cd826a8556b
2010-03-13 13:52:03 +00:00
jens ed483b2e03 - added syscall read
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@786 cc03376c-175c-47c8-b038-4cd826a8556b
2010-03-13 13:51:42 +00:00
jens 8971cdc872 Minor changes
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@785 cc03376c-175c-47c8-b038-4cd826a8556b
2010-03-13 13:51:12 +00:00
jens 0a601d2dd2 - made time specs in nano seconds, thus independent of clock
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@784 cc03376c-175c-47c8-b038-4cd826a8556b
2010-03-13 11:06:43 +00:00
jens ce9ff6339d Initial version
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@783 cc03376c-175c-47c8-b038-4cd826a8556b
2010-03-13 11:03:12 +00:00
jens e27c0f791a update
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@782 cc03376c-175c-47c8-b038-4cd826a8556b
2010-03-13 10:50:30 +00:00
jens 874df39347 - increased MIPS area
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@781 cc03376c-175c-47c8-b038-4cd826a8556b
2010-03-13 10:50:08 +00:00
jens d5922c8f0d Minor changes
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@780 cc03376c-175c-47c8-b038-4cd826a8556b
2010-03-13 10:49:06 +00:00
jens 4ab67a5eab update
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@779 cc03376c-175c-47c8-b038-4cd826a8556b
2010-03-12 09:21:50 +00:00
jens b6219e970b update
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@778 cc03376c-175c-47c8-b038-4cd826a8556b
2010-03-12 09:20:15 +00:00
jens 8dafff2722 update
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@777 cc03376c-175c-47c8-b038-4cd826a8556b
2010-03-12 09:19:52 +00:00
jens f60ac9a09d update
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@776 cc03376c-175c-47c8-b038-4cd826a8556b
2010-03-12 09:01:43 +00:00
jens 90a8a33bb8 - Back to current work
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@775 cc03376c-175c-47c8-b038-4cd826a8556b
2010-03-12 08:37:10 +00:00
jens d820072d82 - Roll back for Release 12
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@774 cc03376c-175c-47c8-b038-4cd826a8556b
2010-03-12 08:30:35 +00:00
jens a73cc52a72 Minor changes
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@773 cc03376c-175c-47c8-b038-4cd826a8556b
2010-03-12 07:41:31 +00:00
jens d30f067cee - added Altera stuff
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@772 cc03376c-175c-47c8-b038-4cd826a8556b
2010-03-12 07:41:16 +00:00
jens 22024a75df update
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@771 cc03376c-175c-47c8-b038-4cd826a8556b
2010-03-12 07:39:51 +00:00
jens 818ede23e1 Minor changes
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@770 cc03376c-175c-47c8-b038-4cd826a8556b
2010-03-12 07:35:21 +00:00
jens aad1f852b5 - improved instant_raw logic. Less false alarms
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@769 cc03376c-175c-47c8-b038-4cd826a8556b
2010-03-11 11:36:10 +00:00
jens 293699d051 update
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@768 cc03376c-175c-47c8-b038-4cd826a8556b
2010-03-11 11:35:25 +00:00
jens 28fc16da87 Initial version
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@767 cc03376c-175c-47c8-b038-4cd826a8556b
2010-03-11 11:35:15 +00:00
jens 7c70fcb680 - added asynchronous BUS FIFOs
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@766 cc03376c-175c-47c8-b038-4cd826a8556b
2010-03-11 11:33:44 +00:00
jens e6f39ee6b5 deleted
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@765 cc03376c-175c-47c8-b038-4cd826a8556b
2010-03-11 11:31:51 +00:00
jens 4f388d5c10 Initial version
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@764 cc03376c-175c-47c8-b038-4cd826a8556b
2010-03-11 11:28:22 +00:00
jens 0499e58f4b update
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@763 cc03376c-175c-47c8-b038-4cd826a8556b
2010-03-11 09:21:29 +00:00
jens a7c1d8fec7 Minor changes
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@762 cc03376c-175c-47c8-b038-4cd826a8556b
2010-03-11 09:21:04 +00:00
jens 56b6044320 Initial version
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@761 cc03376c-175c-47c8-b038-4cd826a8556b
2010-03-11 09:19:56 +00:00
jens 041aeb7974 deleted
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@760 cc03376c-175c-47c8-b038-4cd826a8556b
2010-03-11 09:18:59 +00:00
jens 148c71d2b4 update
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@759 cc03376c-175c-47c8-b038-4cd826a8556b
2010-03-07 16:11:03 +00:00
jens 9bf3b46cf3 - added generic 'simulate_tx' for output of TX-Data into simulation log
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@758 cc03376c-175c-47c8-b038-4cd826a8556b
2010-03-07 16:10:57 +00:00
jens c6983bd768 - added MRDY_O for I/D-Cache
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@757 cc03376c-175c-47c8-b038-4cd826a8556b
2010-03-07 16:00:53 +00:00
jens e5f5e1d0e3 Initial version
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@756 cc03376c-175c-47c8-b038-4cd826a8556b
2010-02-22 19:48:45 +00:00
jens 359869bc2d - added to_01() to timer counter, to avoid simulation warnings
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@755 cc03376c-175c-47c8-b038-4cd826a8556b
2010-02-17 10:54:19 +00:00
jens 943e7e9388 update
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@754 cc03376c-175c-47c8-b038-4cd826a8556b
2010-02-14 17:28:14 +00:00
jens daed8e12a0 - cleaned up
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@753 cc03376c-175c-47c8-b038-4cd826a8556b
2010-02-14 15:44:22 +00:00
jens 60d59f2f07 - cleaned up
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@752 cc03376c-175c-47c8-b038-4cd826a8556b
2010-02-13 10:51:47 +00:00
jens 28056fbdff - added new FIFO generics
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@751 cc03376c-175c-47c8-b038-4cd826a8556b
2010-02-12 10:36:50 +00:00
jens 3c3b5e76a7 - added new FIFO generics
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@750 cc03376c-175c-47c8-b038-4cd826a8556b
2010-02-12 09:52:36 +00:00
jens 651cd11ec0 - added new FIFO generics
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@749 cc03376c-175c-47c8-b038-4cd826a8556b
2010-02-11 21:56:32 +00:00
jens 5889dc2d4a - added new FIFO generics
- no STB_O if Bus input FIFO full.
  => Bus out FIFO is read if SRDY_I = '1'  and MRDY_O = '1'
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@748 cc03376c-175c-47c8-b038-4cd826a8556b
2010-02-11 21:56:03 +00:00
jens 819028cd9b update
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@747 cc03376c-175c-47c8-b038-4cd826a8556b
2010-02-09 12:10:10 +00:00
jens e162dd8798 - removed cpu_clock unrelated path
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@746 cc03376c-175c-47c8-b038-4cd826a8556b
2010-02-09 12:09:53 +00:00
jens 6136f02789 update
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@745 cc03376c-175c-47c8-b038-4cd826a8556b
2010-02-09 11:46:51 +00:00
jens 6b0327c702 - set sys_freq to 100MHz
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@744 cc03376c-175c-47c8-b038-4cd826a8556b
2010-02-09 11:46:41 +00:00
jens fb96e23852 - fixed rounding issue in usec prescaler
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@743 cc03376c-175c-47c8-b038-4cd826a8556b
2010-02-09 11:46:08 +00:00
jens d185bd4aa1 - bugfix
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@742 cc03376c-175c-47c8-b038-4cd826a8556b
2010-02-09 10:21:14 +00:00
jens d47fbfee09 Minor changes
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@741 cc03376c-175c-47c8-b038-4cd826a8556b
2010-02-09 10:20:48 +00:00
jens 6baab07e5a update
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@740 cc03376c-175c-47c8-b038-4cd826a8556b
2010-02-09 10:19:56 +00:00
jens a3a85d2c98 - improved UTILS_FREQ_M(), UTILS_FREQ_D().
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@739 cc03376c-175c-47c8-b038-4cd826a8556b
2010-02-09 10:16:36 +00:00
jens 80dbbd7024 Minor changes to max cycle count
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@738 cc03376c-175c-47c8-b038-4cd826a8556b
2010-02-09 09:56:44 +00:00
jens b6dcc8cc48 Minor changes
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@737 cc03376c-175c-47c8-b038-4cd826a8556b
2010-02-09 09:38:56 +00:00
jens 810ae067bc Minor changes
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@736 cc03376c-175c-47c8-b038-4cd826a8556b
2010-02-09 09:06:00 +00:00
jens c7fa54ce6b - to_cycles() now correctly rounded
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@735 cc03376c-175c-47c8-b038-4cd826a8556b
2010-02-09 08:42:21 +00:00
jens 0c50e933f8 - changed frequencies into MHz units (real data type)
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@734 cc03376c-175c-47c8-b038-4cd826a8556b
2010-02-09 07:50:27 +00:00
jens 385aa5e008 - changed frequencies into MHz units (real data type)
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@733 cc03376c-175c-47c8-b038-4cd826a8556b
2010-02-09 07:25:49 +00:00
jens f6be505eba - added f_syscll_hz generic
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@732 cc03376c-175c-47c8-b038-4cd826a8556b
2010-02-08 07:08:32 +00:00
jens 06c9683eea update
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@731 cc03376c-175c-47c8-b038-4cd826a8556b
2010-02-07 20:46:27 +00:00
jens 823dd066c2 Initial version
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@730 cc03376c-175c-47c8-b038-4cd826a8556b
2010-02-07 19:21:46 +00:00
jens a1aa8dd969 - added asynchronous BUS FIFOs
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@729 cc03376c-175c-47c8-b038-4cd826a8556b
2010-02-07 19:18:10 +00:00
jens ddbf6da277 update
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@728 cc03376c-175c-47c8-b038-4cd826a8556b
2010-02-07 19:17:28 +00:00
jens 023b7e42a3 - added dedicated sys_clk_out frequency synthesis
- SDRAM clocks use sys_clk_out for clock generation
- added cpu_clk_out which is the same as sys_clk_in

Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@727 cc03376c-175c-47c8-b038-4cd826a8556b
2010-02-07 19:16:11 +00:00
jens c42c0ba5b8 - added asynchronous BUS FIFOs
- added cpu_clk
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@726 cc03376c-175c-47c8-b038-4cd826a8556b
2010-02-07 19:12:19 +00:00
jens e0e8566bec - made time specs in nano seconds
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@725 cc03376c-175c-47c8-b038-4cd826a8556b
2010-02-07 19:11:55 +00:00
jens 7f8a82d9ba - added asynchronous BUS FIFOs
- added cpu_clk
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@724 cc03376c-175c-47c8-b038-4cd826a8556b
2010-02-07 19:01:33 +00:00
jens fd84fecaec - bugfix in to_cycles()
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@723 cc03376c-175c-47c8-b038-4cd826a8556b
2010-02-07 18:10:18 +00:00
jens f42e562e14 - made time specs in nano seconds
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@722 cc03376c-175c-47c8-b038-4cd826a8556b
2010-02-07 15:53:23 +00:00
jens 149140cad7 - made time specs in nano seconds, thus independent of clock
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@721 cc03376c-175c-47c8-b038-4cd826a8556b
2010-02-07 15:43:04 +00:00
jens 4cfe77786b - added read enable for DPRAM. Inhibits dout to be altered if FIFO is already empty on reads
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@720 cc03376c-175c-47c8-b038-4cd826a8556b
2010-02-07 13:58:14 +00:00
jens 5dae6793f2 - cleaned up
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@719 cc03376c-175c-47c8-b038-4cd826a8556b
2010-02-07 13:56:25 +00:00
jens b8a69d571a - made time specs in SDRAM_config independent of SDRAM clock
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@718 cc03376c-175c-47c8-b038-4cd826a8556b
2010-02-07 12:54:24 +00:00
jens 010edebc97 - made time specs in SDRAM_config independent of SDRAM clock
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@717 cc03376c-175c-47c8-b038-4cd826a8556b
2010-02-07 12:41:09 +00:00
jens 13c772be6e update
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@716 cc03376c-175c-47c8-b038-4cd826a8556b
2010-02-07 12:40:04 +00:00
jens f98a1c5fd3 update
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@715 cc03376c-175c-47c8-b038-4cd826a8556b
2010-02-06 21:21:11 +00:00
jens 4cd83ee40a Initial version
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@714 cc03376c-175c-47c8-b038-4cd826a8556b
2010-02-06 18:45:56 +00:00
jens f3c5702a67 - removed module reset_virtex4
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@713 cc03376c-175c-47c8-b038-4cd826a8556b
2010-02-06 18:45:30 +00:00
jens 4954924a4c update
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@712 cc03376c-175c-47c8-b038-4cd826a8556b
2010-02-06 18:44:57 +00:00
jens 98e7a547af update
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@711 cc03376c-175c-47c8-b038-4cd826a8556b
2010-02-06 14:14:43 +00:00
jens 56a734bb1a - removed module reset_virtex4
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@710 cc03376c-175c-47c8-b038-4cd826a8556b
2010-02-06 14:12:07 +00:00
jens 2e3f14ea17 - added 16-depth Bus input FIFO (2 cycles additional latency)
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@709 cc03376c-175c-47c8-b038-4cd826a8556b
2010-02-06 14:07:47 +00:00
jens 0b403e7a58 Minor changes
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@708 cc03376c-175c-47c8-b038-4cd826a8556b
2010-02-06 13:16:05 +00:00
jens c2c77faa8c Minor changes
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@707 cc03376c-175c-47c8-b038-4cd826a8556b
2010-01-31 15:17:31 +00:00
jens c49d7464fd Initial version
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@706 cc03376c-175c-47c8-b038-4cd826a8556b
2010-01-31 15:12:12 +00:00
jens 24490316aa Minor changes
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@705 cc03376c-175c-47c8-b038-4cd826a8556b
2010-01-31 15:11:18 +00:00
jens dfb24f6270 Renamed old to new
git-svn-id: http://moon:8086/svn/vhdl/trunk@704 cc03376c-175c-47c8-b038-4cd826a8556b
2010-01-31 13:15:13 +00:00
jens 2b488c8308 Renamed old to new
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@703 cc03376c-175c-47c8-b038-4cd826a8556b
2010-01-31 13:12:43 +00:00
jens e10b69e4fe Renamed old to new
git-svn-id: http://moon:8086/svn/vhdl/trunk@702 cc03376c-175c-47c8-b038-4cd826a8556b
2010-01-31 13:12:27 +00:00
jens a8e50fa8cc Renamed old to new
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@701 cc03376c-175c-47c8-b038-4cd826a8556b
2010-01-31 12:58:44 +00:00
jens 8e56002a55 Renamed old to new
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@700 cc03376c-175c-47c8-b038-4cd826a8556b
2010-01-31 12:58:43 +00:00
jens b9eda20be5 - added H/W blitter support
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@698 cc03376c-175c-47c8-b038-4cd826a8556b
2010-01-31 12:58:13 +00:00
jens a356c98ef3 - redefined regsiter addresses for VGA
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@697 cc03376c-175c-47c8-b038-4cd826a8556b
2010-01-31 12:57:37 +00:00
jens a352a5f9ad - added getpid(), kill(), link(), unlink()
- modifed read()
- added flush() for UART
- added screen_get_resx(), screen_get_resy(), screen_get_fps()
- added some more initializations in libsys_init()
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@696 cc03376c-175c-47c8-b038-4cd826a8556b
2010-01-31 12:57:01 +00:00
jens 2379f58695 - bugfix
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@695 cc03376c-175c-47c8-b038-4cd826a8556b
2010-01-31 12:54:03 +00:00
jens d3b5902e23 update
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@694 cc03376c-175c-47c8-b038-4cd826a8556b
2010-01-09 17:53:09 +00:00
jens 922ade83b7 - added states of pins clk and data to status register
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@693 cc03376c-175c-47c8-b038-4cd826a8556b
2009-12-06 15:22:01 +00:00
jens a1d88baad4 update
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@692 cc03376c-175c-47c8-b038-4cd826a8556b
2009-11-29 16:48:11 +00:00
jens 9a3aa287fd - register set extended for future extensions
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@691 cc03376c-175c-47c8-b038-4cd826a8556b
2009-11-29 16:47:56 +00:00
jens ebf615967c - bugfix: BLIT IRQ-ack had no effect
- increased BLIT chunk-size to 512 QWORDs
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@690 cc03376c-175c-47c8-b038-4cd826a8556b
2009-11-28 20:32:28 +00:00
jens 7023fc8c69 - added 'page_mode_en' inputs for async_port
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@689 cc03376c-175c-47c8-b038-4cd826a8556b
2009-11-27 09:07:24 +00:00
jens 836e446d8b Initial version
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@688 cc03376c-175c-47c8-b038-4cd826a8556b
2009-11-27 08:30:51 +00:00
jens bc956a5d36 update
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@687 cc03376c-175c-47c8-b038-4cd826a8556b
2009-11-27 08:30:39 +00:00
jens 94d1cca7d4 - overwrite src-DIR with tmpl/tb_mips_top.vhd
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@686 cc03376c-175c-47c8-b038-4cd826a8556b
2009-11-27 08:30:33 +00:00
jens 250b732037 update
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@685 cc03376c-175c-47c8-b038-4cd826a8556b
2009-11-25 08:21:36 +00:00
jens f33f341adb update
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@684 cc03376c-175c-47c8-b038-4cd826a8556b
2009-11-24 12:06:21 +00:00
jens 58316c2141 update
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@683 cc03376c-175c-47c8-b038-4cd826a8556b
2009-11-24 11:35:33 +00:00
jens 1f387fdd75 - Loads image for bugfix: instructions uncached LW => cached LW (with cache-miss) was buggy.
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@682 cc03376c-175c-47c8-b038-4cd826a8556b
2009-11-24 11:35:08 +00:00
jens 21b41da6e2 - bugfix: instructions uncached LW => cached LW (with cache-miss) was buggy.
Symptoms:
  ...
1.: lw     $a0, 32($s0)  # Uncached load from memory mapped I/O
2.: lw     $a2, 4($v0)   # Cached load and cache-miss.
                                  # $a0 receives same value as $a2.
                                  # CPU skips writing $a0 due to busy flag of D-Cache,
                                  # which is already active in the previous cycle
...

Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@681 cc03376c-175c-47c8-b038-4cd826a8556b
2009-11-24 11:33:37 +00:00
jens 3eef19bb28 - removed unused 'en' pin.
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@680 cc03376c-175c-47c8-b038-4cd826a8556b
2009-11-24 11:30:36 +00:00
jens c0592b8ef4 - added full support for VGA-master 64-bit read/write to SDRAM
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@679 cc03376c-175c-47c8-b038-4cd826a8556b
2009-11-22 22:38:25 +00:00
jens c752d0a463 update
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@678 cc03376c-175c-47c8-b038-4cd826a8556b
2009-11-22 22:37:29 +00:00
jens cd8a49ad18 - added blitter loop
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@677 cc03376c-175c-47c8-b038-4cd826a8556b
2009-11-22 22:37:20 +00:00
jens fc1a9e7b3d - blitter FIFO is reseted on every new request
- blitter always avaliable regardless of MSTEN
- blit writes finish on blit_fifo_empty. Chunk counter only used for reads
- premature finish of blit reads if NX*NY satisfied. No more chunk granularity
- set BLIT_CHUNK_SIZE to 128 double-pixels

Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@676 cc03376c-175c-47c8-b038-4cd826a8556b
2009-11-22 22:35:55 +00:00
jens f8c39b3cd4 - added blitter completion interrupt
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@675 cc03376c-175c-47c8-b038-4cd826a8556b
2009-11-22 16:25:00 +00:00
jens 01739e1519 - bugfix blitter reset
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@674 cc03376c-175c-47c8-b038-4cd826a8556b
2009-11-22 15:36:07 +00:00
jens 51f9d7849f - corrected blit NX which has to be divided by 2
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@673 cc03376c-175c-47c8-b038-4cd826a8556b
2009-11-22 15:10:50 +00:00
jens 4ff589039a - set 'f_pxl_clk' of 'ts_vga_testbench' tp 40MHz
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@672 cc03376c-175c-47c8-b038-4cd826a8556b
2009-11-22 13:52:27 +00:00
jens 80e3cad985 - added BLITTER
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@671 cc03376c-175c-47c8-b038-4cd826a8556b
2009-11-22 13:50:47 +00:00
jens 3157b3297b - added BLITTER tests
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@670 cc03376c-175c-47c8-b038-4cd826a8556b
2009-11-22 13:50:34 +00:00
jens 935645a97e - added Blitter registers
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@669 cc03376c-175c-47c8-b038-4cd826a8556b
2009-11-21 10:06:51 +00:00
jens 717239c086 - buf_chg_ack also on 'host_fb_back' write
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@668 cc03376c-175c-47c8-b038-4cd826a8556b
2009-11-19 20:35:56 +00:00
jens 514f9e0f58 - increased bous-FIFO depth to 2 bits, to avoid bus-stalls
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@667 cc03376c-175c-47c8-b038-4cd826a8556b
2009-11-19 20:03:49 +00:00
jens f7cbefef82 - added busout-FIFO for future multi-sourced master capability (VGA-scan, blitter)
Bus-out FIFO improved timing so much and leads to 300 less Slice - FIFOs are great!
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@666 cc03376c-175c-47c8-b038-4cd826a8556b
2009-11-19 10:37:58 +00:00
jens ffdc36ef4e - added sync FIFO for busout-FIFO
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@665 cc03376c-175c-47c8-b038-4cd826a8556b
2009-11-19 10:35:52 +00:00
jens 196633c670 Initial version
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@664 cc03376c-175c-47c8-b038-4cd826a8556b
2009-11-18 08:11:22 +00:00
jens 8982313c71 - removed (quick and dirty) copy of front-Pointer to back-Pointer on buffer change. back-Pointer keeps host written value.
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@663 cc03376c-175c-47c8-b038-4cd826a8556b
2009-11-15 22:19:36 +00:00
jens 76baac4f8c - relaxed VGA period to 8 ns.
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@662 cc03376c-175c-47c8-b038-4cd826a8556b
2009-11-15 22:01:46 +00:00
jens a6129174e5 update
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@661 cc03376c-175c-47c8-b038-4cd826a8556b
2009-11-15 10:21:45 +00:00
jens 5d23284412 - added RDY generator => SLAVE is not always ready => better test.
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@660 cc03376c-175c-47c8-b038-4cd826a8556b
2009-11-15 10:17:53 +00:00
jens 07a03b76f3 - removed 'sdr_data_req_r'
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@659 cc03376c-175c-47c8-b038-4cd826a8556b
2009-11-15 10:10:28 +00:00
jens 974b6bfb14 update
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@658 cc03376c-175c-47c8-b038-4cd826a8556b
2009-11-11 10:29:31 +00:00
jens c30d40d42b update
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@657 cc03376c-175c-47c8-b038-4cd826a8556b
2009-11-11 10:26:37 +00:00
jens 9ba64d156f update
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@656 cc03376c-175c-47c8-b038-4cd826a8556b
2009-11-11 08:18:17 +00:00
jens 9b5fb2ad78 update
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@655 cc03376c-175c-47c8-b038-4cd826a8556b
2009-11-11 07:44:55 +00:00
jens 593390a93d - changed register defines to UPPER-CASE
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@654 cc03376c-175c-47c8-b038-4cd826a8556b
2009-11-09 20:36:16 +00:00
jens 576357a4d4 - removed btn-east for hard-reset
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@653 cc03376c-175c-47c8-b038-4cd826a8556b
2009-11-09 20:30:32 +00:00
jens 9253fd1df8 - minor changes to make ISE meet timing
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@652 cc03376c-175c-47c8-b038-4cd826a8556b
2009-11-09 20:29:54 +00:00
jens 9975fbd6cc - changes due to packing of resx, resy and fps into one 32-bit register
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@651 cc03376c-175c-47c8-b038-4cd826a8556b
2009-11-09 19:15:25 +00:00
jens 18c24e29f6 - renamed buffers to fb_front and fb_back
- fb_front is writable by host only if msten = '0'. fb_back is writable by host every time.
- fb_front and fb_back are changed after complete frame. Controller can issue buffer-change Interrupt
- packed resx, resy and fps into one 32-bit register
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@650 cc03376c-175c-47c8-b038-4cd826a8556b
2009-11-09 19:14:49 +00:00
jens 5fbb10f98d update
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@649 cc03376c-175c-47c8-b038-4cd826a8556b
2009-11-09 19:13:48 +00:00
jens ec59074ba6 update
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@648 cc03376c-175c-47c8-b038-4cd826a8556b
2009-11-08 22:32:36 +00:00
jens 084ed1064a update
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@647 cc03376c-175c-47c8-b038-4cd826a8556b
2009-11-08 22:30:30 +00:00
jens de99799f14 - minor changes
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@646 cc03376c-175c-47c8-b038-4cd826a8556b
2009-11-08 21:53:11 +00:00
jens fd0896f374 - added INT_O line for VGA
- mapped VGA-Int to IRQ5
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@645 cc03376c-175c-47c8-b038-4cd826a8556b
2009-11-08 21:51:06 +00:00
jens f0ad8cc351 update
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@644 cc03376c-175c-47c8-b038-4cd826a8556b
2009-11-08 21:50:11 +00:00
jens 444e7530e1 - bugfix: added 'bufchg_irq_en' to registers
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@643 cc03376c-175c-47c8-b038-4cd826a8556b
2009-11-08 21:50:03 +00:00
jens 618e8b54b0 update
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@642 cc03376c-175c-47c8-b038-4cd826a8556b
2009-11-08 20:23:22 +00:00
jens fcfe1d1d79 - added double buffer
- added INT_O on buffer change
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@641 cc03376c-175c-47c8-b038-4cd826a8556b
2009-11-08 20:23:11 +00:00
jens c465b190a0 Initial version
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@640 cc03376c-175c-47c8-b038-4cd826a8556b
2009-11-08 13:07:55 +00:00
jens 9413b8d798 - changed register defines to UPPER-CASE
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@639 cc03376c-175c-47c8-b038-4cd826a8556b
2009-11-08 13:06:12 +00:00
jens 100634f883 - added
void Screen_clr(void);
  void Screen_line_clr(void);
  void Screen_csr_set_x(UINT32 coord);
  void Screen_csr_set_y(UINT32 coord);
- changed register defines to UPPER-CASE


Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@638 cc03376c-175c-47c8-b038-4cd826a8556b
2009-11-08 13:05:26 +00:00
jens 24d11d565e - removed call to dbg_init()
- added call to libsys_init() which calls dbg_init().
- added
  void Screen_clr(void);
  void Screen_line_clr(void);
  void Screen_csr_set_x(UINT32 coord);
  void Screen_csr_set_y(UINT32 coord);
- changed register defines to UPPER-CASE


Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@637 cc03376c-175c-47c8-b038-4cd826a8556b
2009-11-08 13:05:13 +00:00
jens 21fa0293d6 - removed call to dbg_init()
- added call to libsys_init() which calls dbg_init(). libsys_init()  is in libsys.c
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@636 cc03376c-175c-47c8-b038-4cd826a8556b
2009-11-08 13:03:06 +00:00
jens 56b6095f3b - more improvements on PS2 stuff
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@635 cc03376c-175c-47c8-b038-4cd826a8556b
2009-11-08 13:02:00 +00:00
jens e64f0709af - added DrawBox() test
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@634 cc03376c-175c-47c8-b038-4cd826a8556b
2009-11-08 13:01:25 +00:00
jens da76ef5d48 - turned all sys_clk-related async. resets to sys_clk synchronous resets
- scroll-disable when cursor y-pos was set

Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@633 cc03376c-175c-47c8-b038-4cd826a8556b
2009-11-07 15:00:51 +00:00
jens 1cd391f0bc update
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@632 cc03376c-175c-47c8-b038-4cd826a8556b
2009-11-07 12:01:22 +00:00
jens 570b03bca4 - added error flags
- RX abort when rx_buffer already full (error flag set)
- added parity error flag
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@631 cc03376c-175c-47c8-b038-4cd826a8556b
2009-11-07 12:01:11 +00:00
jens 19f258f351 - added error flags
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@630 cc03376c-175c-47c8-b038-4cd826a8556b
2009-11-07 11:59:48 +00:00
jens 04c4f04452 - minor changes
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@629 cc03376c-175c-47c8-b038-4cd826a8556b
2009-11-06 22:56:16 +00:00
jens a9b4edf095 - better - more sphisticated
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@628 cc03376c-175c-47c8-b038-4cd826a8556b
2009-11-06 21:33:14 +00:00
jens f5cfe810ef - added getchar()
- minor bugfixes
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@627 cc03376c-175c-47c8-b038-4cd826a8556b
2009-11-06 21:22:12 +00:00
jens 4a5d55bd7e - uptodate will never be rebuilt
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@626 cc03376c-175c-47c8-b038-4cd826a8556b
2009-11-06 21:21:30 +00:00
jens 9adba48b45 - changes due to libsys changes
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@625 cc03376c-175c-47c8-b038-4cd826a8556b
2009-11-06 21:21:02 +00:00
jens e9ce7f666a - removed STDOUT and STDERR defines
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@624 cc03376c-175c-47c8-b038-4cd826a8556b
2009-11-06 20:49:39 +00:00
jens edcba93a3a - cleaned up
- introduced generic UART-lowlevel I/O with interface object
 (less functions, which do the same)
- added PS2-I/O and keycode translator (quick'n dirty)
- writechar(), readchar() and _putchar() have now a port parameter
- there are now 3 console interfaces available UART0, UART1 and PS2/VGA
- the small function GetPort() maps between filei ID and low-level port
- the small function GetPort() maps between

Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@623 cc03376c-175c-47c8-b038-4cd826a8556b
2009-11-06 20:48:43 +00:00
jens 877ad05014 - due to changes in libsys.c, readchar() has now a port parameter
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@622 cc03376c-175c-47c8-b038-4cd826a8556b
2009-11-06 20:43:56 +00:00
jens 012623b603 Initial version
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@621 cc03376c-175c-47c8-b038-4cd826a8556b
2009-11-06 15:29:54 +00:00
jens 646e49e5b9 update
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@620 cc03376c-175c-47c8-b038-4cd826a8556b
2009-11-06 15:28:38 +00:00
jens 256301db76 - added PS2 interface 0/1
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@619 cc03376c-175c-47c8-b038-4cd826a8556b
2009-11-06 15:28:25 +00:00
jens df6d009bee - added PS2 interface 1
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@618 cc03376c-175c-47c8-b038-4cd826a8556b
2009-11-06 15:27:59 +00:00
jens 33f61f3007 - added PS2 interface 0
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@617 cc03376c-175c-47c8-b038-4cd826a8556b
2009-11-06 13:14:44 +00:00
jens f9d1fc4945 - better - more sphisticated
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@616 cc03376c-175c-47c8-b038-4cd826a8556b
2009-11-05 17:16:24 +00:00
jens 9158fc6655 - changed DSTDERR_FUNCTION=_cg_putchar
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@615 cc03376c-175c-47c8-b038-4cd826a8556b
2009-11-05 17:16:02 +00:00
jens d8517c136e - changed VGA register offset and bits
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@614 cc03376c-175c-47c8-b038-4cd826a8556b
2009-11-05 17:15:28 +00:00
jens c9ba66b646 update
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@613 cc03376c-175c-47c8-b038-4cd826a8556b
2009-11-05 17:13:42 +00:00
jens 84b52da6e1 - changed VGA resolution to ts_vga_800_600_60
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@612 cc03376c-175c-47c8-b038-4cd826a8556b
2009-11-05 17:13:05 +00:00
jens 35c1a5973d - changed VGA resolution to 1280x1024@72
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@611 cc03376c-175c-47c8-b038-4cd826a8556b
2009-11-05 13:43:28 +00:00
jens 0e3e910804 update
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@610 cc03376c-175c-47c8-b038-4cd826a8556b
2009-11-05 13:42:43 +00:00
jens dd24468d48 Initial version
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@609 cc03376c-175c-47c8-b038-4cd826a8556b
2009-11-05 12:02:23 +00:00
jens 4a1eafc312 - added global clock generator
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@608 cc03376c-175c-47c8-b038-4cd826a8556b
2009-11-05 12:02:10 +00:00
jens 85779bda74 update
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@607 cc03376c-175c-47c8-b038-4cd826a8556b
2009-11-05 12:01:48 +00:00
jens 9485906877 - removed clkgen. VGA-clock generated in TB
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@606 cc03376c-175c-47c8-b038-4cd826a8556b
2009-11-05 11:55:53 +00:00
jens 85ca2bc0dd update
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@605 cc03376c-175c-47c8-b038-4cd826a8556b
2009-11-04 19:33:11 +00:00
jens 2ab1b93e51 - changed register rudimentary register layout (new offsets!)
- added new regsiter features: status/ctrl register cursor position, screen resolution


Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@604 cc03376c-175c-47c8-b038-4cd826a8556b
2009-11-04 19:31:47 +00:00
jens 381e7cc659 - added cursor position status port
- 'dout' is set to last written character
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@603 cc03376c-175c-47c8-b038-4cd826a8556b
2009-11-04 19:29:50 +00:00
jens 7a4dff1301 - more documentation
- more tests
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@602 cc03376c-175c-47c8-b038-4cd826a8556b
2009-11-04 19:28:52 +00:00
jens 6e1e0e1cd2 - minor bugfix (inclusion of distributed DPRAM, which doesn't exist)
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@601 cc03376c-175c-47c8-b038-4cd826a8556b
2009-11-04 19:28:11 +00:00
jens c33943f991 - minor bugfix (width mismatch)
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@600 cc03376c-175c-47c8-b038-4cd826a8556b
2009-11-04 19:26:53 +00:00
jens 3065e22f8f Initial version
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@599 cc03376c-175c-47c8-b038-4cd826a8556b
2009-11-04 10:51:36 +00:00
jens 57efb02eb6 - removed BUFG for clk_out. It's now in clkgen
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@598 cc03376c-175c-47c8-b038-4cd826a8556b
2009-11-04 10:39:59 +00:00
jens 05a24f5fda - added BUFG for clk_out
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@597 cc03376c-175c-47c8-b038-4cd826a8556b
2009-11-04 10:39:14 +00:00
jens 61919ba257 - Minor changes
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@596 cc03376c-175c-47c8-b038-4cd826a8556b
2009-11-04 00:20:00 +00:00
jens 86e6050f60 update
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@595 cc03376c-175c-47c8-b038-4cd826a8556b
2009-11-04 00:17:35 +00:00
jens bf4d61bb10 - Minor changes
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@594 cc03376c-175c-47c8-b038-4cd826a8556b
2009-11-03 23:50:00 +00:00
jens 1843d4de60 - added separate SD-CLK generator
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@593 cc03376c-175c-47c8-b038-4cd826a8556b
2009-11-03 23:25:29 +00:00
jens a3904fef4c - FIFO-depth of CMD-FIFO is not hardwired anymore. It's set to top-level FIFO-depth
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@592 cc03376c-175c-47c8-b038-4cd826a8556b
2009-11-03 23:25:06 +00:00
jens 643a506496 - changed TIMESPEC for VGA
- added TIMESPEC  for SDRAM
- SDRAM_CLK is now unrelated to SYS_CLK
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@591 cc03376c-175c-47c8-b038-4cd826a8556b
2009-11-03 22:52:50 +00:00
jens bfed7a6680 - changed CMD_FIFO_ADDR_WIDTH = 5
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@590 cc03376c-175c-47c8-b038-4cd826a8556b
2009-11-03 22:51:19 +00:00
jens 054d232b6c - added clkgen for vga
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@589 cc03376c-175c-47c8-b038-4cd826a8556b
2009-11-03 22:50:04 +00:00
jens b4be8c7433 update
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@588 cc03376c-175c-47c8-b038-4cd826a8556b
2009-11-03 22:13:10 +00:00
jens 06fccfd7af - added clkgen for vga
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@587 cc03376c-175c-47c8-b038-4cd826a8556b
2009-11-03 22:10:12 +00:00
jens c418244065 update
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@586 cc03376c-175c-47c8-b038-4cd826a8556b
2009-11-03 20:54:00 +00:00
jens fb119f08dd - include async. FIFO
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@585 cc03376c-175c-47c8-b038-4cd826a8556b
2009-11-03 20:53:32 +00:00
jens 738004f6ec - added clkgen for vga
- initialized master-mode
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@584 cc03376c-175c-47c8-b038-4cd826a8556b
2009-11-03 20:52:15 +00:00
jens 7cdf99b1f5 - pulled out clkgen. vga_clk is now provided from higher level
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@583 cc03376c-175c-47c8-b038-4cd826a8556b
2009-11-03 20:51:17 +00:00
jens 0c716c1cde - cleaned up
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@582 cc03376c-175c-47c8-b038-4cd826a8556b
2009-11-03 20:50:51 +00:00
jens b15b435913 - include utils_pkg
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@581 cc03376c-175c-47c8-b038-4cd826a8556b
2009-11-03 20:50:28 +00:00
jens e0f0157686 - put general helper functions to utils_pkg
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@580 cc03376c-175c-47c8-b038-4cd826a8556b
2009-11-03 20:49:07 +00:00
jens 2894ed417a update
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@579 cc03376c-175c-47c8-b038-4cd826a8556b
2009-11-03 20:47:16 +00:00
jens d908ae0e9e - SDRAM can now operate at different speed than BUS clock
- separated bus-clock (sys_clk) and SDRAM-clocks
  - added async. FIFOs for clock domain separation
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@578 cc03376c-175c-47c8-b038-4cd826a8556b
2009-11-03 20:42:27 +00:00
jens 88d3bd6607 - cleaned up
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@577 cc03376c-175c-47c8-b038-4cd826a8556b
2009-11-03 20:38:55 +00:00
jens ee04924d42 - added helper functions for DCM frequency synthesis
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@576 cc03376c-175c-47c8-b038-4cd826a8556b
2009-11-03 20:38:30 +00:00
jens 6f27bf0c89 Initial version
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@575 cc03376c-175c-47c8-b038-4cd826a8556b
2009-11-03 12:59:40 +00:00
jens 76ef050e55 Initial version
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@574 cc03376c-175c-47c8-b038-4cd826a8556b
2009-11-03 12:13:44 +00:00
jens eaa359df6b Initial version
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@573 cc03376c-175c-47c8-b038-4cd826a8556b
2009-11-03 09:59:34 +00:00
jens 04e357869f - bugfix: set Pos X/Y : data was not set.
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@572 cc03376c-175c-47c8-b038-4cd826a8556b
2009-11-02 19:00:37 +00:00
jens 915d700d67 update
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@571 cc03376c-175c-47c8-b038-4cd826a8556b
2009-11-02 10:29:39 +00:00
jens 77d214b705 - always specified leadout and release states, regardless of CPU-strobe (better timing)
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@570 cc03376c-175c-47c8-b038-4cd826a8556b
2009-11-02 10:29:23 +00:00
jens 0bd204d435 update
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@569 cc03376c-175c-47c8-b038-4cd826a8556b
2009-10-30 13:55:15 +00:00
jens 2db39f4504 - zero lead-in / lead-out,
but added 4 cycles relelease necessary for writes. See tWR in datasheet)
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@568 cc03376c-175c-47c8-b038-4cd826a8556b
2009-10-30 13:55:06 +00:00
jens d37afef047 - some performance improvements
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@567 cc03376c-175c-47c8-b038-4cd826a8556b
2009-10-30 13:51:00 +00:00
jens a38101e448 - Minor changes
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@566 cc03376c-175c-47c8-b038-4cd826a8556b
2009-10-30 12:27:36 +00:00
jens e85aded32a update
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@565 cc03376c-175c-47c8-b038-4cd826a8556b
2009-10-30 12:27:18 +00:00
jens d5254aa0d7 - writes have at least lead-in of one cycle if lead-in is speifified to 0
- no data drive during lead-out
- no instant data drive in idle on 'en'
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@564 cc03376c-175c-47c8-b038-4cd826a8556b
2009-10-30 12:26:42 +00:00
jens 989fe72ddb - read-page cycle is minimum 2 cycles
- change assertion check: Read page pulse length must be greater than one

Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@563 cc03376c-175c-47c8-b038-4cd826a8556b
2009-10-30 10:49:15 +00:00
jens 9ad3c6cd4e - now 30 ns
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@562 cc03376c-175c-47c8-b038-4cd826a8556b
2009-10-29 22:57:11 +00:00
jens 41067b50fc - Minor changes
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@561 cc03376c-175c-47c8-b038-4cd826a8556b
2009-10-29 22:56:20 +00:00
jens a6490e8007 - minor changes to flash_addr
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@560 cc03376c-175c-47c8-b038-4cd826a8556b
2009-10-29 20:54:48 +00:00
jens ba2264ed97 - changed ROM names to make TB run again
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@558 cc03376c-175c-47c8-b038-4cd826a8556b
2009-10-28 23:25:02 +00:00
jens 3072e46951 - removed PrintCPUInfo()
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@557 cc03376c-175c-47c8-b038-4cd826a8556b
2009-10-28 23:18:16 +00:00
jens 19fe5c9005 - removed ROM-depth generic
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@556 cc03376c-175c-47c8-b038-4cd826a8556b
2009-10-28 23:13:33 +00:00
jens d9f9c66962 - removed XMEM-wait
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@555 cc03376c-175c-47c8-b038-4cd826a8556b
2009-10-28 23:12:36 +00:00
jens ec8a4254a9 update
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@554 cc03376c-175c-47c8-b038-4cd826a8556b
2009-10-28 23:11:11 +00:00
jens 8ee78f468d - added IOB_DELAY=NONE to 'sys_flash_d'
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@553 cc03376c-175c-47c8-b038-4cd826a8556b
2009-10-28 23:08:10 +00:00
jens 00234a1efd update
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@552 cc03376c-175c-47c8-b038-4cd826a8556b
2009-10-28 22:54:04 +00:00
jens a3d54edf64 - added 'page_mode_en' for async_port
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@551 cc03376c-175c-47c8-b038-4cd826a8556b
2009-10-28 22:45:36 +00:00
jens 9ea208eaf0 -added new page_read parameters
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@550 cc03376c-175c-47c8-b038-4cd826a8556b
2009-10-28 22:45:24 +00:00
jens 6ab6c0632c -added new page_read. Page read can be en/disabled
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@549 cc03376c-175c-47c8-b038-4cd826a8556b
2009-10-28 22:44:07 +00:00
jens 6da937fe58 - flash has access time of 25 ns
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@548 cc03376c-175c-47c8-b038-4cd826a8556b
2009-10-28 10:43:27 +00:00
jens 1d72b92b46 - Booting from Flash is now from cached area (faster)
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@547 cc03376c-175c-47c8-b038-4cd826a8556b
2009-10-27 23:46:07 +00:00
jens 2d45364d7e - minor no functional changes
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@546 cc03376c-175c-47c8-b038-4cd826a8556b
2009-10-27 23:45:48 +00:00
jens b56a35171a - Booting from Flash is now from cached area (faster)
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@545 cc03376c-175c-47c8-b038-4cd826a8556b
2009-10-27 23:35:49 +00:00
jens 194eacd637 - added sys_flash_mem
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@544 cc03376c-175c-47c8-b038-4cd826a8556b
2009-10-27 23:32:42 +00:00
jens 8aa77da2b1 - bugfix: wrong number of available flash blocks
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@543 cc03376c-175c-47c8-b038-4cd826a8556b
2009-10-27 23:32:10 +00:00
jens 034f28a4f6 - change names of block align functions
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@542 cc03376c-175c-47c8-b038-4cd826a8556b
2009-10-27 23:32:09 +00:00
jens 9cdec8e722 update
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@541 cc03376c-175c-47c8-b038-4cd826a8556b
2009-10-27 21:59:32 +00:00
jens efa1c33c13 Initial revison
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@540 cc03376c-175c-47c8-b038-4cd826a8556b
2009-10-27 21:58:11 +00:00
jens ecb22dfeee - operate UART2 and UART1 in parallel for monitoring
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@539 cc03376c-175c-47c8-b038-4cd826a8556b
2009-10-27 21:49:40 +00:00
jens 5ecfef0595 - changed names
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@538 cc03376c-175c-47c8-b038-4cd826a8556b
2009-10-27 21:48:53 +00:00
jens 0b8624c6ac update
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@537 cc03376c-175c-47c8-b038-4cd826a8556b
2009-10-27 21:48:07 +00:00
jens 3709ffcefe - async_port_timing: Changed names and timing diagram
to reflect V1.6 of async_port_wb.vhdl

Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@536 cc03376c-175c-47c8-b038-4cd826a8556b
2009-10-27 21:42:08 +00:00
jens 8b49c6197c - redesigned FSM. Zero leadin, zeroleadout and zero release is now possible
- added assertion check for zero r/w-pulses
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@535 cc03376c-175c-47c8-b038-4cd826a8556b
2009-10-27 21:25:36 +00:00
jens c8306cafc4 - changed names
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@534 cc03376c-175c-47c8-b038-4cd826a8556b
2009-10-27 21:22:03 +00:00
jens 4a5178da93 - added flash_we_n
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@533 cc03376c-175c-47c8-b038-4cd826a8556b
2009-10-27 21:21:50 +00:00
jens 5d7fed1259 - removed force-TX-IRQ and TX-IRQ acknowledge
- TX-IRQ is always asserted if tx-FIFO is empty and tx-inten is active.
  If TX-INT is not desired, it has to be switched off manually by TX-Inten.

Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@532 cc03376c-175c-47c8-b038-4cd826a8556b
2009-10-24 20:27:57 +00:00
jens 116defca80 - BIU: corrected drawing thickness of data lines
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@531 cc03376c-175c-47c8-b038-4cd826a8556b
2009-10-24 15:00:58 +00:00
jens ddeccf3a34 - added force TX-interrupt register bit (0x200)
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@530 cc03376c-175c-47c8-b038-4cd826a8556b
2009-10-18 18:46:06 +00:00
jens 65404dbba8 update
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@529 cc03376c-175c-47c8-b038-4cd826a8556b
2009-10-17 21:47:27 +00:00
jens 6130b4c260 - Bugfix: argc and argv were not correctly set. New introduced bug because of minor change.
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@528 cc03376c-175c-47c8-b038-4cd826a8556b
2009-10-17 21:46:19 +00:00
jens 08f122c910 Initial revison
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@527 cc03376c-175c-47c8-b038-4cd826a8556b
2009-10-17 17:41:54 +00:00
jens 97453f606e - added LWL/LWR bypass
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@526 cc03376c-175c-47c8-b038-4cd826a8556b
2009-10-17 17:40:46 +00:00
jens fe950520b4 update
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@525 cc03376c-175c-47c8-b038-4cd826a8556b
2009-10-17 17:35:37 +00:00
jens a07b596168 - added some comments
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@524 cc03376c-175c-47c8-b038-4cd826a8556b
2009-10-17 17:33:45 +00:00
jens d8083946f3 - changed NMI/RST behavior: reset exception entered after NMI/RST transition 1 => 0.
- BEV = 1 after NMI/RST (like hard reset)
- status not KUc,IEc not saved to KUp, IEp at NMI/RST (like hard reset)
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@523 cc03376c-175c-47c8-b038-4cd826a8556b
2009-10-17 17:19:41 +00:00
jens 44b4412d53 update
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@522 cc03376c-175c-47c8-b038-4cd826a8556b
2009-10-17 14:14:33 +00:00
jens 55ef215f63 update
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@521 cc03376c-175c-47c8-b038-4cd826a8556b
2009-10-17 14:10:44 +00:00
jens 774fe348b5 update
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@520 cc03376c-175c-47c8-b038-4cd826a8556b
2009-10-17 13:15:51 +00:00
jens 584ac47a8a - Bugfix: register bypass with same target register, used for unaligned loads (LWL, LWR), was incorrect.
Newlib's memcpy() (MIPS-optimized) uses this for unaligned copy.
  Consectutive load instructions without nops using same target register (which is legal) like
   lw $1, 0(mem)
   lwl $1, 1(mem)
  or
   lwl $1, 0(mem)
   lwr $1, 1(mem)
  or similar, lead to incorrect result. Now it's fixed.


git-svn-id: http://moon:8086/svn/vhdl/trunk@519 cc03376c-175c-47c8-b038-4cd826a8556b
2009-10-17 12:58:28 +00:00
jens 8159135dfd update
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@518 cc03376c-175c-47c8-b038-4cd826a8556b
2009-10-17 12:58:15 +00:00
jens 6ac97e7bf3 added second UART
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@517 cc03376c-175c-47c8-b038-4cd826a8556b
2009-10-14 22:06:19 +00:00
jens 51ea254c82 removed error defines (they are in libsys.h)
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@516 cc03376c-175c-47c8-b038-4cd826a8556b
2009-10-14 22:05:50 +00:00
jens eafadbfa05 added target: serdump
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@515 cc03376c-175c-47c8-b038-4cd826a8556b
2009-10-14 22:05:12 +00:00
jens a6cf47015c - initialization fix in write()
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@514 cc03376c-175c-47c8-b038-4cd826a8556b
2009-10-14 22:04:46 +00:00
jens 730714620d - added 'sys_flash_mem'
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@513 cc03376c-175c-47c8-b038-4cd826a8556b
2009-10-14 22:04:45 +00:00
jens 73dcae8d35 added more UART low-level functions
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@512 cc03376c-175c-47c8-b038-4cd826a8556b
2009-10-14 22:04:44 +00:00
jens abb030f663 added endian switch for convenient endian switching
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@511 cc03376c-175c-47c8-b038-4cd826a8556b
2009-10-14 22:02:57 +00:00
jens 749c8a6144 - added addtional UART (4 UARTS in total)
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@510 cc03376c-175c-47c8-b038-4cd826a8556b
2009-10-14 21:33:41 +00:00
jens 9a1a5579bf Bugfix in gen_fill_mask_rom (wrong result on zero shift amounts due to width mismatch)
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@509 cc03376c-175c-47c8-b038-4cd826a8556b
2009-10-14 21:15:31 +00:00
jens 47c0a1b682 - added tx-complete and tx-empty to ports
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@508 cc03376c-175c-47c8-b038-4cd826a8556b
2009-10-13 21:21:57 +00:00
jens 5b743dea38 - fixed broken tx-interrupt
- added tx_int and rx_int to status reg
- tx-int is acked by writing to ctrl reg
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@507 cc03376c-175c-47c8-b038-4cd826a8556b
2009-10-13 21:21:22 +00:00
jens 38b70b722c - extended baudrate register from 8 to 16 bits, allowing very low baudrates
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@506 cc03376c-175c-47c8-b038-4cd826a8556b
2009-10-09 09:37:43 +00:00
jens a6b19c1621 - added two addtional UARTs
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@505 cc03376c-175c-47c8-b038-4cd826a8556b
2009-10-08 21:34:20 +00:00
jens 45d8f099ca - added two addtional UARTs. UART2 not operable (just loopback) due to synthesize problems - or a bug
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@504 cc03376c-175c-47c8-b038-4cd826a8556b
2009-10-08 21:34:00 +00:00
jens 15d9de633c - added two addtional UARTs
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@503 cc03376c-175c-47c8-b038-4cd826a8556b
2009-10-08 21:32:34 +00:00
jens b288e8ee43 update
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@502 cc03376c-175c-47c8-b038-4cd826a8556b
2009-10-08 21:31:57 +00:00
jens 4b25be2021 - removed odd dist-versions of FIFOs and RAM
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@501 cc03376c-175c-47c8-b038-4cd826a8556b
2009-10-03 17:19:11 +00:00
jens 8549615cd0 update to R12
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@500 cc03376c-175c-47c8-b038-4cd826a8556b
2009-10-03 17:18:05 +00:00
jens 822059724f update
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@499 cc03376c-175c-47c8-b038-4cd826a8556b
2009-10-03 17:17:26 +00:00
jens c104a7b916 - added pin non-maskable interrupt (NMI).
Exception vector is reset vector at (X"BFC00000")
- added pin 'eb' for endian little/big choice. 'eb' is sampled at reset
- UART(): merged TX and RX interrupt to one interrupt line

Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@498 cc03376c-175c-47c8-b038-4cd826a8556b
2009-10-03 17:16:22 +00:00
jens 3a8641003e - added pin non-maskable interrupt (NMI).
Exception vector is reset vector at (X"BFC00000")


Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@497 cc03376c-175c-47c8-b038-4cd826a8556b
2009-10-03 17:01:36 +00:00
jens 2424f52409 - added configurable endian flags
- added more programs
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@496 cc03376c-175c-47c8-b038-4cd826a8556b
2009-10-03 16:50:16 +00:00
jens 237fc3d163 - changes, changes
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@495 cc03376c-175c-47c8-b038-4cd826a8556b
2009-10-03 16:49:32 +00:00
jens 21f33a1768 - added exception vector table.
S/W can write exception handler entry to this table.
  Exception handler can now reside anywhere in memory.

Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@494 cc03376c-175c-47c8-b038-4cd826a8556b
2009-10-03 16:48:28 +00:00
jens f706de00bb - _irq_dispatch(): IP masked by IM in software
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@493 cc03376c-175c-47c8-b038-4cd826a8556b
2009-10-03 16:45:29 +00:00
jens f3d4b8bdb3 - Hex reader entered at reset if GPIO.3 is active (ML402 South Button)
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@492 cc03376c-175c-47c8-b038-4cd826a8556b
2009-10-03 16:44:02 +00:00
jens 48da5e410e - Flush of I/D-cache at boot
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@491 cc03376c-175c-47c8-b038-4cd826a8556b
2009-10-03 16:43:00 +00:00
jens e7b85e0138 - added pin non-maskable interrupt (NMI).
Exception vector is reset vector at (X"BFC00000")


Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@490 cc03376c-175c-47c8-b038-4cd826a8556b
2009-10-03 16:41:26 +00:00
jens c5027772aa - added pin non-maskable interrupt (NMI).
Exception vector is reset vector at (X"BFC00000")
-  Interrupt pending flags (IP) are not masked in hardware by IM.

Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@489 cc03376c-175c-47c8-b038-4cd826a8556b
2009-10-03 16:40:29 +00:00
jens 63b60eee52 update
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@488 cc03376c-175c-47c8-b038-4cd826a8556b
2009-08-09 16:53:45 +00:00
jens 830f840b83 - minor changes
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@487 cc03376c-175c-47c8-b038-4cd826a8556b
2009-08-08 18:54:45 +00:00
jens 3d02793488 - detailed EX_stage according to implementation
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@486 cc03376c-175c-47c8-b038-4cd826a8556b
2009-08-08 17:25:09 +00:00
jens 27d59cb442 - COP dout generated from MEM_ex_result and DMEM_din with multiplexer, to reduce fanout of MEM.data.
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@485 cc03376c-175c-47c8-b038-4cd826a8556b
2009-08-08 14:00:28 +00:00
jens 1e0fc89d3a - added COP data lines to pipeline
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@484 cc03376c-175c-47c8-b038-4cd826a8556b
2009-08-08 12:39:24 +00:00
jens 2316880678 minor changes
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@483 cc03376c-175c-47c8-b038-4cd826a8556b
2009-08-08 12:39:01 +00:00
jens e2da4a5108 update
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@482 cc03376c-175c-47c8-b038-4cd826a8556b
2009-08-08 12:38:22 +00:00
jens 331590cc36 - Status.TS tied high to indicate absence of an MMU
- Removed possibility of writng read-only status bits
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@481 cc03376c-175c-47c8-b038-4cd826a8556b
2009-08-08 12:37:43 +00:00
jens 874ed6f824 del
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@480 cc03376c-175c-47c8-b038-4cd826a8556b
2009-08-07 12:04:54 +00:00
jens bea098d743 - doubled I-Cache size to 32kByte
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@479 cc03376c-175c-47c8-b038-4cd826a8556b
2009-05-10 09:47:24 +00:00
jens 1fe9a2c398 - replaced comparator-based fill-stage with rom-based fill-stage
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@478 cc03376c-175c-47c8-b038-4cd826a8556b
2009-05-09 19:19:03 +00:00
jens 6449f3fa78 - minor changes (better timing)
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@477 cc03376c-175c-47c8-b038-4cd826a8556b
2009-05-08 22:19:35 +00:00
jens 1884f3158c - minor changes (bug)
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@476 cc03376c-175c-47c8-b038-4cd826a8556b
2009-05-08 21:48:31 +00:00
jens 9794a67ba6 - Reset vector is now injected during reset like an ordinary exception.
This minimizes pc.nxt MUX (Better timing)
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@475 cc03376c-175c-47c8-b038-4cd826a8556b
2009-05-08 21:44:27 +00:00
jens 6f74cd1662 - removed register output latch (latch introduced global clock buffer, which is deprecated)
- CPU is configured as BIG-endian
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@474 cc03376c-175c-47c8-b038-4cd826a8556b
2009-05-06 21:35:03 +00:00
jens f046307aa9 - removed reference to fifo_sync_dist.
Use fifo_sync instead and specified ditributed ram_style
  in XCF-file during synthesis

Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@473 cc03376c-175c-47c8-b038-4cd826a8556b
2009-05-06 21:30:23 +00:00
jens 0edf614e5e - removed reference to fifo_sync_dist.
Use fifo_sync instead and specified ditributed ram_style
  in XCF-file during synthesis

Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@472 cc03376c-175c-47c8-b038-4cd826a8556b
2009-05-06 10:36:58 +00:00
jens eabf73aa4f - renamed pc.is_branch:boolean to pc.branch_take:std_logic
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@471 cc03376c-175c-47c8-b038-4cd826a8556b
2009-05-05 22:07:19 +00:00
jens 3de1c312bb - removed register output latch (latch introduced global clock buffer, which is deprecated)
- added separate reg_pointer for read/write
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@470 cc03376c-175c-47c8-b038-4cd826a8556b
2009-05-05 11:07:02 +00:00
jens 1c17d74ae1 - removed INT_O_TX from UART. Use now common INT_O for RX/TX
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@469 cc03376c-175c-47c8-b038-4cd826a8556b
2009-05-03 09:30:58 +00:00
jens 134119db33 - bugfix: ICACHE_invalidate_at() after user-break was missing
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@468 cc03376c-175c-47c8-b038-4cd826a8556b
2009-05-02 16:23:01 +00:00
jens f6ce6d39e7 - removed timer stuff
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@467 cc03376c-175c-47c8-b038-4cd826a8556b
2009-05-02 16:23:00 +00:00
jens fc342f5734 - added timer stuff
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@466 cc03376c-175c-47c8-b038-4cd826a8556b
2009-05-02 16:21:48 +00:00
jens 52a8946996 - added global EL/EB switch for convenient switching between endianess
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@465 cc03376c-175c-47c8-b038-4cd826a8556b
2009-05-02 16:20:33 +00:00
jens 22149e3dfd - added searchdirs
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@464 cc03376c-175c-47c8-b038-4cd826a8556b
2009-05-02 16:19:52 +00:00
jens b9bdef1e30 - bootloader is left in kernel-mode
- improved flash error handling
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@463 cc03376c-175c-47c8-b038-4cd826a8556b
2009-05-02 16:19:31 +00:00
jens efa56c97f2 - added error macros
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@462 cc03376c-175c-47c8-b038-4cd826a8556b
2009-05-02 16:18:44 +00:00
jens a2a17fd24a - improved erase/program failure detection
- added block_lock/unlock functions
- locked blocks are unlocked automatically during erase
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@461 cc03376c-175c-47c8-b038-4cd826a8556b
2009-05-02 16:18:20 +00:00
jens 66984e5b25 - added timer and error macros
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@460 cc03376c-175c-47c8-b038-4cd826a8556b
2009-05-02 16:16:49 +00:00
jens b5e1d45b20 - added test color register base + 0x80
- control signals derived from register file are noe registered for better timing
- mem_offset updated from vga_mem_offset wehn new frame begins
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@459 cc03376c-175c-47c8-b038-4cd826a8556b
2009-05-01 19:26:43 +00:00
jens 4c309f1eef - SR(7 .. 0) are not writable in user-mode
- registered 'ctrl_out.int' for better timing
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@458 cc03376c-175c-47c8-b038-4cd826a8556b
2009-04-27 08:23:08 +00:00
jens 20dc046c75 - status register is always writable
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@457 cc03376c-175c-47c8-b038-4cd826a8556b
2009-04-19 17:57:33 +00:00
jens d97c9dd6ec - added interrupt enable
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@456 cc03376c-175c-47c8-b038-4cd826a8556b
2009-04-19 17:56:47 +00:00
jens cd867dad7d - added 2. Interrupt timer
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@455 cc03376c-175c-47c8-b038-4cd826a8556b
2009-04-17 22:49:31 +00:00
jens 2e57a02355 - changed Exception vector from 0x80000180 to 0x80000080
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@454 cc03376c-175c-47c8-b038-4cd826a8556b
2009-04-17 20:30:57 +00:00
jens ef6b247b01 Initial version
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@453 cc03376c-175c-47c8-b038-4cd826a8556b
2009-04-17 20:30:56 +00:00
jens 68429fd3b0 - many new tests
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@452 cc03376c-175c-47c8-b038-4cd826a8556b
2009-04-15 14:13:41 +00:00
jens 917ceced01 - switched to big-endian biuld
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@451 cc03376c-175c-47c8-b038-4cd826a8556b
2009-04-15 14:13:00 +00:00
jens 69a654f218 - added gunzip, life and r3
- switched to big-endian biuld
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@450 cc03376c-175c-47c8-b038-4cd826a8556b
2009-04-15 14:12:42 +00:00
jens 83d260fc0d - Minor changes
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@449 cc03376c-175c-47c8-b038-4cd826a8556b
2009-04-15 14:11:46 +00:00
jens 79de05d54c Initial version
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@448 cc03376c-175c-47c8-b038-4cd826a8556b
2009-04-15 14:11:45 +00:00
jens be038f16ba - changed irg-handler prototype: irq-handler now obtain pointer to exception context
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@447 cc03376c-175c-47c8-b038-4cd826a8556b
2009-04-15 14:06:30 +00:00
jens 4452820f09 - added function to register exception handlers
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@446 cc03376c-175c-47c8-b038-4cd826a8556b
2009-04-15 14:05:33 +00:00
jens 133df33e35 - increased exception stack frame to 32kB
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@445 cc03376c-175c-47c8-b038-4cd826a8556b
2009-04-15 14:04:59 +00:00
jens 47d5b9ac7f - removed unportable clock() used time() instead
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@444 cc03376c-175c-47c8-b038-4cd826a8556b
2009-04-15 14:04:21 +00:00
jens 1be58489b0 - added function for I/D-cache invalidate
- added functions for LWC0 and SWC0
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@443 cc03376c-175c-47c8-b038-4cd826a8556b
2009-04-15 14:03:20 +00:00
jens cf72d81cd3 - minor changes
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@442 cc03376c-175c-47c8-b038-4cd826a8556b
2009-04-15 14:02:10 +00:00
jens 0b1cd9b7b1 - added PrintBuffer8() and memdump()
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@441 cc03376c-175c-47c8-b038-4cd826a8556b
2009-04-15 14:01:08 +00:00
jens f3ee78329b - uart_baud rate is now written as DWORD
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@440 cc03376c-175c-47c8-b038-4cd826a8556b
2009-04-15 14:00:29 +00:00
jens 842553943a - added switch EB/EL to switch endianess
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@439 cc03376c-175c-47c8-b038-4cd826a8556b
2009-04-15 13:56:58 +00:00
jens a00c0c1a0d - added call to debugger init routine
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@438 cc03376c-175c-47c8-b038-4cd826a8556b
2009-04-15 13:46:27 +00:00
jens 30340bd6cf - added mixed I/D exceptions (13, 14)
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@437 cc03376c-175c-47c8-b038-4cd826a8556b
2009-04-15 13:46:00 +00:00
jens 4372265ee2 - added big-endian to lib-searchpath
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@436 cc03376c-175c-47c8-b038-4cd826a8556b
2009-04-15 13:43:41 +00:00
jens e19528b20f - added support functions:
flash_aligned_addr_by...() to obtain block aligned addresses
- removed query in flash_find due to stack-problems
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@435 cc03376c-175c-47c8-b038-4cd826a8556b
2009-04-15 13:41:41 +00:00
jens 893e93530d - update
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@434 cc03376c-175c-47c8-b038-4cd826a8556b
2009-04-15 13:39:59 +00:00
jens 2fb198d941 - added port 'eb' for Endian-big selection
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@433 cc03376c-175c-47c8-b038-4cd826a8556b
2009-04-15 13:23:30 +00:00
jens b8890b0132 - new big-endian bootloader
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@432 cc03376c-175c-47c8-b038-4cd826a8556b
2009-04-15 13:23:22 +00:00
jens d3c322ca48 - bugfix: wrong 'pa_offset' when big-endian and half-word load/store
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@431 cc03376c-175c-47c8-b038-4cd826a8556b
2009-04-15 13:22:31 +00:00
jens a3c4ba6e82 - minor improvements for load/store shifter
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@430 cc03376c-175c-47c8-b038-4cd826a8556b
2009-04-15 13:21:39 +00:00
jens 1c5db27de0 - removed SEL for register writes
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@429 cc03376c-175c-47c8-b038-4cd826a8556b
2009-04-15 13:19:23 +00:00
jens f34847adb1 - some new control signals in cop0_ctrl
- added exc-Flag in WB_stage
- simplified int signals

Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@428 cc03376c-175c-47c8-b038-4cd826a8556b
2009-04-11 08:37:11 +00:00
jens b5b15b90e2 - Int-port is now at cop instead of pipeline
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@427 cc03376c-175c-47c8-b038-4cd826a8556b
2009-04-11 08:35:46 +00:00
jens d3e486b6d5 Reworked exception FSM:
- Pipeline is now flushed and finished and all dependencies are solved before entering exception handler
  - User mode writes on status register are now correctly finished before status is altered by exception
  - Processor stalls for 2 cycles after RFE to ensure that status register is correct in user mode
- Added int-port


Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@426 cc03376c-175c-47c8-b038-4cd826a8556b
2009-04-11 08:34:50 +00:00
jens ae50048039 - reworked exception stuff
- removed int-port (it's now in cop)

Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@425 cc03376c-175c-47c8-b038-4cd826a8556b
2009-04-11 08:30:41 +00:00
jens a94fb20d4f - Update
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@424 cc03376c-175c-47c8-b038-4cd826a8556b
2009-04-07 07:16:11 +00:00
jens 5b9f651efe -Mips-Pipeline stages: added missing register for PC-Branch
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@423 cc03376c-175c-47c8-b038-4cd826a8556b
2009-04-06 11:14:28 +00:00
jens 68ba887854 -Mips-Pipeline: added missing register for PC-Branch
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@422 cc03376c-175c-47c8-b038-4cd826a8556b
2009-04-06 10:35:48 +00:00
jens 6983e7ebec - removed weird feature, which prevents cop registers to be written in front of exception.
cop register behavior is now hopefully the same as general registers.
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@421 cc03376c-175c-47c8-b038-4cd826a8556b
2009-03-30 23:29:33 +00:00
jens 2e1850c19b - redesigned
- added invalidate_all and invalidate_at control
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@420 cc03376c-175c-47c8-b038-4cd826a8556b
2009-03-30 22:26:15 +00:00
jens 599380bd10 - 'dcache_en' now doesn't depend on CYC_O_dmem_rd or write_busy
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@419 cc03376c-175c-47c8-b038-4cd826a8556b
2009-03-30 22:25:29 +00:00
jens eb22574d20 - changed reset generator and added BIU-Reset signal
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@418 cc03376c-175c-47c8-b038-4cd826a8556b
2009-03-30 09:05:19 +00:00
jens 1cbfc94fde - added control port
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@417 cc03376c-175c-47c8-b038-4cd826a8556b
2009-03-29 12:03:14 +00:00
jens 4dc562bfe5 - removed MUX for RESET_VECTOR in proc_stage_pc:
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@416 cc03376c-175c-47c8-b038-4cd826a8556b
2009-03-28 18:27:05 +00:00
jens e89e61291a - assigned c0_ctrl to BIU for cache_ctrl
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@415 cc03376c-175c-47c8-b038-4cd826a8556b
2009-03-28 18:26:33 +00:00
jens ad0284bd10 - added cache_ctrl input
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@414 cc03376c-175c-47c8-b038-4cd826a8556b
2009-03-28 18:25:53 +00:00
jens 962cffac1d - added cache_ctrl record. Used in c0_ctrl_out
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@413 cc03376c-175c-47c8-b038-4cd826a8556b
2009-03-28 18:25:23 +00:00
jens 7892b38128 - added Cop instructions COP0 32, COP0 33, COP 34, COP0 35:
ICACHE_invalidate_at, ICACHE_invalidate_all,
   DCACHE_invalidate_at, DCACHE_invalidate_all.

Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@412 cc03376c-175c-47c8-b038-4cd826a8556b
2009-03-28 18:24:35 +00:00
jens 2761d5926b - added timer inrterrupt
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@411 cc03376c-175c-47c8-b038-4cd826a8556b
2009-03-27 11:16:54 +00:00
jens 5a3f3d4cbe - removed idecode_rom.vhd
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@410 cc03376c-175c-47c8-b038-4cd826a8556b
2009-03-27 11:15:35 +00:00
jens 241658d3ba - removed idecode_rom.vhd
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@409 cc03376c-175c-47c8-b038-4cd826a8556b
2009-03-20 22:42:32 +00:00
jens 8054aedcb5 - Update
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@408 cc03376c-175c-47c8-b038-4cd826a8556b
2009-03-20 20:27:23 +00:00
jens dbff927a63 - cop ouput register is now latch (better timing)
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@407 cc03376c-175c-47c8-b038-4cd826a8556b
2009-03-20 19:15:11 +00:00
jens 52e9decf78 - added instructions 'lwc0' and 'swc0' for testing (which are usually invalid)
- due to cop_reg_we in MEM_Stage, the output register is removed
  (timing is slightly degraded). The reg pointer is delayed instead by one cycle
- test-reg is now writable in user mode regardles of cop0 usability.
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@406 cc03376c-175c-47c8-b038-4cd826a8556b
2009-03-18 23:30:08 +00:00
jens 2dfce691ce - added instructions 'lwcz' and 'swcz'.
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@405 cc03376c-175c-47c8-b038-4cd826a8556b
2009-03-18 22:40:33 +00:00
jens c97b7cdf39 - Update
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@404 cc03376c-175c-47c8-b038-4cd826a8556b
2009-03-18 10:08:05 +00:00
jens 7225dcfa87 - removed idecode_rom.vhd
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@403 cc03376c-175c-47c8-b038-4cd826a8556b
2009-03-17 09:49:57 +00:00
jens 1a0e8f08f5 - removed cop_reg_rd
if cop is read is now implemented into instruction decoder
- generate 'stall_all' signal if ID/EX/MEM stall is active

Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@402 cc03376c-175c-47c8-b038-4cd826a8556b
2009-03-17 09:39:07 +00:00
jens b201db2193 - new signal 'cop_read' in ctrl_lines
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@401 cc03376c-175c-47c8-b038-4cd826a8556b
2009-03-17 09:37:39 +00:00
jens 5140d7a6fa - - removed cop_reg_rd
if cop is read is now implemented into instruction decoder

Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@400 cc03376c-175c-47c8-b038-4cd826a8556b
2009-03-17 09:36:58 +00:00
jens 9cb7ef5930 - more decoding of cop_signals.
New cop_read is now implemented into instruction decoder

Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@399 cc03376c-175c-47c8-b038-4cd826a8556b
2009-03-17 09:36:33 +00:00
jens 4bf6b28c71 - removed 'reg_rd' which is fed into pipeline.
if cop is read is now implemented into instruction decoder
- simplified use of stall signals
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@398 cc03376c-175c-47c8-b038-4cd826a8556b
2009-03-17 09:35:39 +00:00
jens e2c40b91a1 - added COPz debugging identifier
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@397 cc03376c-175c-47c8-b038-4cd826a8556b
2009-03-16 11:46:24 +00:00
jens 8d6a5af6c8 - deleted
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@396 cc03376c-175c-47c8-b038-4cd826a8556b
2009-03-16 11:35:42 +00:00
jens 4f99ce0c87 - added opcode debugging identfier MFCz, MTCz, CFCz, CTCz, BCTz, BCFz for COP functions
- removed COPz debugging identifier

Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@395 cc03376c-175c-47c8-b038-4cd826a8556b
2009-03-16 11:34:40 +00:00
jens 81c8bf1897 - simplified instruction decoder and removed genrom functions
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@394 cc03376c-175c-47c8-b038-4cd826a8556b
2009-03-16 11:31:51 +00:00
jens e465dc860b - 'cop_dout' is now generated in pipeline in MEM_STAGE.
This gives possibility to load cop with memory contents (LWCz).
- dmem_dout can be EX_STAGE.reg_b by default or cop_din if cop_instr_en is asserted.
  This give possibility to store cop content to memory (SWCz)
- removed idecode_rom. Uses opcode_ctrl_lines() directly.



Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@393 cc03376c-175c-47c8-b038-4cd826a8556b
2009-03-16 11:30:41 +00:00
jens 180dad1fe3 - cop uses 'din' directly without delay. 'Din' is now generated in pipeline in MEM_STAGE.
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@392 cc03376c-175c-47c8-b038-4cd826a8556b
2009-03-16 11:27:02 +00:00
jens c1d14214ac - new release 12
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@391 cc03376c-175c-47c8-b038-4cd826a8556b
2009-03-15 20:41:56 +00:00
jens 4f19324605 - added cop0 here
- added cache line sizes to generic

Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@390 cc03376c-175c-47c8-b038-4cd826a8556b
2009-03-15 20:12:37 +00:00
jens ae421c7a15 - removed cop0
- added interface for external cop0 and copz
- reworked cop_read and cop_write signals.
  Using only cop_read which is delay in pipeline


Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@389 cc03376c-175c-47c8-b038-4cd826a8556b
2009-03-15 20:11:47 +00:00
jens b44d2ba1f9 - common functions lg2() and po2() added
- reworked cop0_ctrl_in/out types

Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@388 cc03376c-175c-47c8-b038-4cd826a8556b
2009-03-15 20:09:27 +00:00
jens a332b172b3 - cleaned up: removed lg2() and po2() to mips_types
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@387 cc03376c-175c-47c8-b038-4cd826a8556b
2009-03-15 20:08:16 +00:00
jens cd8b53c3f3 - added cache config to generic to create cache info in upper 16 bits PrID
- unified control signals for later use with Copz
- cleaned up
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@386 cc03376c-175c-47c8-b038-4cd826a8556b
2009-03-15 20:07:39 +00:00
jens 8282389078 - added cache line sizes to generic
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@385 cc03376c-175c-47c8-b038-4cd826a8556b
2009-03-15 20:05:51 +00:00
jens 2a5dd91588 - Update
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@384 cc03376c-175c-47c8-b038-4cd826a8556b
2009-03-15 02:37:24 +00:00
jens 09d21bef97 - added detail to jbus-timing
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@383 cc03376c-175c-47c8-b038-4cd826a8556b
2009-03-15 02:19:03 +00:00
jens ac89acfbeb - deleted
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@382 cc03376c-175c-47c8-b038-4cd826a8556b
2009-03-14 17:19:59 +00:00
jens 58f704112c - Cleanedup toolchain
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@381 cc03376c-175c-47c8-b038-4cd826a8556b
2009-03-14 17:19:29 +00:00
jens 5f24a7e1dc - FLASH alias at 0x00000000
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@380 cc03376c-175c-47c8-b038-4cd826a8556b
2009-03-14 16:38:07 +00:00
jens f643864e54 - removed timer reset dring RST_I
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@379 cc03376c-175c-47c8-b038-4cd826a8556b
2009-03-10 10:36:29 +00:00
jens bd19ea587b - Uncached DMEM is now spec. conform from A0000000..BFFFFFFF (instead A0000000..AFFFFFFF)
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@378 cc03376c-175c-47c8-b038-4cd826a8556b
2009-03-08 14:06:39 +00:00
jens 538c115367 - Update
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@376 cc03376c-175c-47c8-b038-4cd826a8556b
2009-03-01 18:32:40 +00:00
jens ea356d50e3 - date set works now correctly
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@375 cc03376c-175c-47c8-b038-4cd826a8556b
2009-03-01 18:23:28 +00:00
jens 2c9f747259 Initial version
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@374 cc03376c-175c-47c8-b038-4cd826a8556b
2009-03-01 18:13:20 +00:00
jens 15ba5e691f - new release 11
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@373 cc03376c-175c-47c8-b038-4cd826a8556b
2009-03-01 18:13:07 +00:00
jens 6b4a578ccc Initial version
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@372 cc03376c-175c-47c8-b038-4cd826a8556b
2009-03-01 17:51:24 +00:00
jens c3b72ca3a9 - reformatted exception dump
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@371 cc03376c-175c-47c8-b038-4cd826a8556b
2009-03-01 17:49:49 +00:00
jens 32d5cf7674 - decrease RAM requirements
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@370 cc03376c-175c-47c8-b038-4cd826a8556b
2009-03-01 17:49:35 +00:00
jens 7cad6e874d - new target 'test_exception'
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@369 cc03376c-175c-47c8-b038-4cd826a8556b
2009-03-01 17:49:02 +00:00
jens a7387810b9 - regsiter zeroise before main()
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@368 cc03376c-175c-47c8-b038-4cd826a8556b
2009-03-01 17:48:44 +00:00
jens c5394b8b22 - minor changes
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@367 cc03376c-175c-47c8-b038-4cd826a8556b
2009-03-01 17:48:25 +00:00
jens 548c2b4e94 - removed interrupt polarity capabilty
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@366 cc03376c-175c-47c8-b038-4cd826a8556b
2009-02-28 13:17:32 +00:00
jens 92a1179fee - removed edge trigger capabilty
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@365 cc03376c-175c-47c8-b038-4cd826a8556b
2009-02-28 12:43:53 +00:00
jens 0f52e03f7b - removed xmem_wait
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@364 cc03376c-175c-47c8-b038-4cd826a8556b
2009-02-28 12:43:02 +00:00
jens 62e35386a5 - removed edge trigger capabilty
- removed xmem_wait
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@363 cc03376c-175c-47c8-b038-4cd826a8556b
2009-02-28 12:42:44 +00:00
jens 15651ad162 Initial version
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@362 cc03376c-175c-47c8-b038-4cd826a8556b
2009-02-16 22:55:34 +00:00
jens cae7d9eb39 - copies now mips_sys from templates
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@361 cc03376c-175c-47c8-b038-4cd826a8556b
2009-02-16 22:55:07 +00:00
jens 6ce723794d - inreased flash and sram to 32kB
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@360 cc03376c-175c-47c8-b038-4cd826a8556b
2009-02-16 22:53:30 +00:00
jens 8018a94936 - bug-fix: pc_is_branch is now initialized at reset (fixes CPU unrecoverable state after reset)
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@359 cc03376c-175c-47c8-b038-4cd826a8556b
2009-02-16 22:48:17 +00:00
jens 08466372b2 - new release candidate 11
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@358 cc03376c-175c-47c8-b038-4cd826a8556b
2009-02-16 22:46:33 +00:00
jens 2667c79d70 - Update
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@357 cc03376c-175c-47c8-b038-4cd826a8556b
2009-02-15 18:42:48 +00:00
jens 4ade970e3f - added async_port timing
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@356 cc03376c-175c-47c8-b038-4cd826a8556b
2009-02-15 17:37:43 +00:00
jens 6afb5d9c2e - minor changes
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@355 cc03376c-175c-47c8-b038-4cd826a8556b
2009-02-15 17:33:07 +00:00
jens ea7e05ba30 - Cleaned up
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@354 cc03376c-175c-47c8-b038-4cd826a8556b
2009-02-15 17:32:48 +00:00
jens c3c42386d8 - reintroduced explicit 'rag_ram_re'
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@353 cc03376c-175c-47c8-b038-4cd826a8556b
2009-02-15 11:09:14 +00:00
jens e874bfa228 - put dependency signals 'imem_dep', 'dmem_dep' and 'mul_dep' into structure for easier debugging
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@352 cc03376c-175c-47c8-b038-4cd826a8556b
2009-02-15 11:08:50 +00:00
jens 3057cdd154 - bugfix tools-dir
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@351 cc03376c-175c-47c8-b038-4cd826a8556b
2009-02-14 16:42:34 +00:00
jens 2e7765311c - new revision 10b
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@350 cc03376c-175c-47c8-b038-4cd826a8556b
2009-02-14 16:36:37 +00:00
jens d06519bd49 - minor changes
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@349 cc03376c-175c-47c8-b038-4cd826a8556b
2009-02-14 16:36:23 +00:00
jens 1c1eae6e8e - using env. vars for tool dirs
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@348 cc03376c-175c-47c8-b038-4cd826a8556b
2009-02-14 15:36:13 +00:00
jens e32cecbfe4 - minor changes
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@347 cc03376c-175c-47c8-b038-4cd826a8556b
2009-02-14 15:35:59 +00:00
jens 200cc27da2 - skipped unimportant test
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@346 cc03376c-175c-47c8-b038-4cd826a8556b
2009-02-14 15:35:46 +00:00
jens b656379683 - added install target
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@345 cc03376c-175c-47c8-b038-4cd826a8556b
2009-02-14 15:02:28 +00:00
jens 7d818d0db4 - vga_frontend* used wrong raster coords (y was swapped) - fixed
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@344 cc03376c-175c-47c8-b038-4cd826a8556b
2009-02-13 08:51:41 +00:00
jens 2987754b98 - minor changes
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@343 cc03376c-175c-47c8-b038-4cd826a8556b
2009-02-11 11:08:02 +00:00
jens 1597bc6240 - re-added state 'rd_cache'
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@341 cc03376c-175c-47c8-b038-4cd826a8556b
2009-02-11 10:55:42 +00:00
jens 44ef835b7a - removed explicit tag_ram_read
- remove state 'rd_cache'
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@340 cc03376c-175c-47c8-b038-4cd826a8556b
2009-02-11 10:32:19 +00:00
jens 905094be8b - put reset-logic outside pipeline
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@339 cc03376c-175c-47c8-b038-4cd826a8556b
2009-02-11 09:52:55 +00:00
jens 3def04d376 - minor changes
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@338 cc03376c-175c-47c8-b038-4cd826a8556b
2009-02-10 10:07:19 +00:00
jens e159dd917b - added ram section
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@337 cc03376c-175c-47c8-b038-4cd826a8556b
2009-02-10 10:07:01 +00:00
jens 1861ea2a60 - skipped initialization of UART (already done in bootloader)
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@336 cc03376c-175c-47c8-b038-4cd826a8556b
2009-02-10 10:06:37 +00:00
jens 99c1ef6686 - TCL-gen for Chipscope 10.1
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@334 cc03376c-175c-47c8-b038-4cd826a8556b
2009-02-09 10:25:50 +00:00
jens 95596c23ff - new revision 10a
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@333 cc03376c-175c-47c8-b038-4cd826a8556b
2009-02-09 10:21:03 +00:00
jens 4baea1c92c - removed linking of libm
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@332 cc03376c-175c-47c8-b038-4cd826a8556b
2009-02-09 10:07:49 +00:00
jens e333f6ca2a - fixed missing nop after lw
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@331 cc03376c-175c-47c8-b038-4cd826a8556b
2009-02-09 10:07:26 +00:00
jens 295d996216 - removed sram-section
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@330 cc03376c-175c-47c8-b038-4cd826a8556b
2009-02-08 18:28:27 +00:00
jens 6ff7294c1e - removed ram_wb
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@329 cc03376c-175c-47c8-b038-4cd826a8556b
2009-02-08 18:20:42 +00:00
jens fed261182c - new build
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@328 cc03376c-175c-47c8-b038-4cd826a8556b
2009-02-08 18:19:18 +00:00
jens 9bff7ff2ae -rename *sync_fifo to fifo_*sync
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@327 cc03376c-175c-47c8-b038-4cd826a8556b
2009-02-08 17:38:46 +00:00
jens 0e825a1df5 - use async_be
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@326 cc03376c-175c-47c8-b038-4cd826a8556b
2009-02-08 17:34:55 +00:00
jens 5226b0bb0a - added async_be
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@325 cc03376c-175c-47c8-b038-4cd826a8556b
2009-02-08 17:34:18 +00:00
jens a1afb1e9c5 - SEL_O asserts correctly for uncached reads
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@324 cc03376c-175c-47c8-b038-4cd826a8556b
2009-02-08 17:33:34 +00:00
jens 5ce761ead5 - removed RAM-init during synthesizing
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@323 cc03376c-175c-47c8-b038-4cd826a8556b
2009-02-08 17:32:41 +00:00
jens 4f6b9e2082 - R0 clear during reset
- dmem_be active also during read

Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@322 cc03376c-175c-47c8-b038-4cd826a8556b
2009-02-08 17:32:22 +00:00
jens 397eb46e02 - minor changes
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@320 cc03376c-175c-47c8-b038-4cd826a8556b
2009-02-07 11:50:55 +00:00
jens d74ba76649 Initial version
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@319 cc03376c-175c-47c8-b038-4cd826a8556b
2009-02-07 11:44:03 +00:00
jens 2895aa265a - targets 'bootloader' (without flash) and 'bootloader_flash' (with flash) available
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@318 cc03376c-175c-47c8-b038-4cd826a8556b
2009-02-07 11:43:54 +00:00
jens b9f89bb7f2 - removed flash stuff. Put flash stuff to 'bootloader_with_flash.c'
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@317 cc03376c-175c-47c8-b038-4cd826a8556b
2009-02-07 11:42:55 +00:00
jens 2e6aed7e91 - copies doc/*.txt to release
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@316 cc03376c-175c-47c8-b038-4cd826a8556b
2009-02-07 11:40:58 +00:00
jens 8476888778 - new build
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@315 cc03376c-175c-47c8-b038-4cd826a8556b
2009-02-07 11:40:11 +00:00
jens 856f335db3 -added generic map for 'mips_top'
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@314 cc03376c-175c-47c8-b038-4cd826a8556b
2009-02-07 11:01:15 +00:00
jens ec84f598aa - new revision 10
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@313 cc03376c-175c-47c8-b038-4cd826a8556b
2009-02-06 10:17:45 +00:00
jens 9e43596a76 - removed stall during instant_raw on same word_index (improves performance)
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@312 cc03376c-175c-47c8-b038-4cd826a8556b
2009-02-04 20:13:32 +00:00
jens eebb15e773 - added memset() test
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@311 cc03376c-175c-47c8-b038-4cd826a8556b
2009-02-01 19:40:56 +00:00
jens 4282eb6221 - initializing of 'gp'
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@310 cc03376c-175c-47c8-b038-4cd826a8556b
2009-02-01 19:40:44 +00:00
jens f2ea795156 Initial version
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@309 cc03376c-175c-47c8-b038-4cd826a8556b
2009-02-01 19:37:54 +00:00
jens 3e6b68932f - new link.ld derived from ld-linker default
- uses small-data sections
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@308 cc03376c-175c-47c8-b038-4cd826a8556b
2009-02-01 19:37:03 +00:00
jens 1c754e35ab - using new link.ld
- omitted -no-gpopt
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@307 cc03376c-175c-47c8-b038-4cd826a8556b
2009-02-01 19:35:53 +00:00
jens 1cce8b6526 - using libsys.a
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@306 cc03376c-175c-47c8-b038-4cd826a8556b
2009-02-01 19:33:26 +00:00
jens 0ee9f8f3fa - newlib build inside GCC
- omitted -no-gpopt
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@305 cc03376c-175c-47c8-b038-4cd826a8556b
2009-02-01 19:23:06 +00:00
jens 94b90d1fef Initial version
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@304 cc03376c-175c-47c8-b038-4cd826a8556b
2009-02-01 19:22:18 +00:00
jens 30cfa326f2 - added performance values for different cache sizes
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@303 cc03376c-175c-47c8-b038-4cd826a8556b
2009-01-31 10:57:36 +00:00
jens cc122dd696 - renamed fifo
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@302 cc03376c-175c-47c8-b038-4cd826a8556b
2009-01-31 08:59:03 +00:00
jens f0636b8805 - renamed fifo ports
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@301 cc03376c-175c-47c8-b038-4cd826a8556b
2009-01-30 21:43:56 +00:00
jens 917db4cc8b - update
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@300 cc03376c-175c-47c8-b038-4cd826a8556b
2009-01-30 21:43:29 +00:00
jens f3d47b0bb9 - renamed fifo_*sync_ctrl
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@299 cc03376c-175c-47c8-b038-4cd826a8556b
2009-01-30 21:30:22 +00:00
jens 5ed37017b5 - renamed fifo_*sync_ctrl
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@298 cc03376c-175c-47c8-b038-4cd826a8556b
2009-01-30 21:30:21 +00:00
jens b3da8c3d7b - renamed
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@297 cc03376c-175c-47c8-b038-4cd826a8556b
2009-01-30 21:22:25 +00:00
jens c605a19368 - deleted
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@296 cc03376c-175c-47c8-b038-4cd826a8556b
2009-01-30 21:22:12 +00:00
jens 70a8763f3b Initial version
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@295 cc03376c-175c-47c8-b038-4cd826a8556b
2009-01-30 21:18:46 +00:00
jens e0504e7320 - deleted
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@294 cc03376c-175c-47c8-b038-4cd826a8556b
2009-01-30 21:17:09 +00:00
jens aacedf75a9 - deleted
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@293 cc03376c-175c-47c8-b038-4cd826a8556b
2009-01-30 21:11:41 +00:00
jens f2faffb88f - renamed
git-svn-id: http://moon:8086/svn/vhdl/trunk@292 cc03376c-175c-47c8-b038-4cd826a8556b
2009-01-30 21:06:43 +00:00
jens 4d5f821e7a - added header
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@290 cc03376c-175c-47c8-b038-4cd826a8556b
2009-01-30 21:04:42 +00:00
jens 538a55d1a2 - added '-mno-gpopt'
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@289 cc03376c-175c-47c8-b038-4cd826a8556b
2009-01-26 09:56:29 +00:00
jens 0b7f09d0d9 - added sections .scommon* and .gnu*
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@288 cc03376c-175c-47c8-b038-4cd826a8556b
2009-01-26 09:53:34 +00:00
jens 342de5f159 using binutils-2.19
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@287 cc03376c-175c-47c8-b038-4cd826a8556b
2009-01-24 17:17:42 +00:00
jens 2c59e2959f using gcc 4.3.2
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@286 cc03376c-175c-47c8-b038-4cd826a8556b
2009-01-24 16:03:16 +00:00
jens 3970467a7d - flashgen: new bigendian target
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@285 cc03376c-175c-47c8-b038-4cd826a8556b
2009-01-24 14:55:57 +00:00
jens 464eb37a7d using gcc 4.3.2
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@284 cc03376c-175c-47c8-b038-4cd826a8556b
2009-01-24 14:55:17 +00:00
jens 2151b77ef3 - JBus-ports are unsigned instead of word_t
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@283 cc03376c-175c-47c8-b038-4cd826a8556b
2009-01-24 14:54:08 +00:00
jens a691c0b7fa using gcc 4.3.2
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@282 cc03376c-175c-47c8-b038-4cd826a8556b
2009-01-24 14:15:42 +00:00
jens c0985f0f53 - flashgen: new bigendian target
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@281 cc03376c-175c-47c8-b038-4cd826a8556b
2009-01-24 14:13:35 +00:00
jens 5aff9e1b93 - JBus-ports are unsigned instead of word_t
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@280 cc03376c-175c-47c8-b038-4cd826a8556b
2009-01-24 14:11:17 +00:00
jens c3507638c1 - generic for cache sizes
- JBus-ports are unsigned instead of word_t
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@279 cc03376c-175c-47c8-b038-4cd826a8556b
2009-01-24 14:10:59 +00:00
jens 4a79ecce80 - JBus-timing: removed ACK_I during write.
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@278 cc03376c-175c-47c8-b038-4cd826a8556b
2009-01-23 20:46:29 +00:00
jens 68b045848e Initial version
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@277 cc03376c-175c-47c8-b038-4cd826a8556b
2009-01-23 20:44:28 +00:00
jens f681936a59 - renamed bui, icache and dcache
git-svn-id: http://moon:8086/svn/vhdl/trunk@276 cc03376c-175c-47c8-b038-4cd826a8556b
2009-01-23 20:29:14 +00:00
jens cfe818b87b Initial version
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@274 cc03376c-175c-47c8-b038-4cd826a8556b
2009-01-21 09:57:19 +00:00
jens 9d43d91da8 - update
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@273 cc03376c-175c-47c8-b038-4cd826a8556b
2009-01-21 09:57:00 +00:00
jens 8867efa451 Initial version
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@272 cc03376c-175c-47c8-b038-4cd826a8556b
2009-01-21 08:52:05 +00:00
jens 25e3d4f36f - changed to rev.9
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@270 cc03376c-175c-47c8-b038-4cd826a8556b
2009-01-20 21:26:48 +00:00
jens 3db7aa0fb4 - removed commented lines
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@269 cc03376c-175c-47c8-b038-4cd826a8556b
2009-01-20 21:19:41 +00:00
jens 523e216793 - removed PCK_FIO (not needed)
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@268 cc03376c-175c-47c8-b038-4cd826a8556b
2009-01-19 10:05:43 +00:00
jens bd4b69206f - Minor changes
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@267 cc03376c-175c-47c8-b038-4cd826a8556b
2009-01-18 22:36:15 +00:00
jens 61e740cc1d - deleted
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@266 cc03376c-175c-47c8-b038-4cd826a8556b
2009-01-18 22:27:29 +00:00
jens 592c158275 Initial version
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@265 cc03376c-175c-47c8-b038-4cd826a8556b
2009-01-18 22:25:52 +00:00
jens 791e97a873 - update
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@264 cc03376c-175c-47c8-b038-4cd826a8556b
2009-01-18 22:20:49 +00:00
jens 0b5b8ceed7 - removed duplicate entry
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@263 cc03376c-175c-47c8-b038-4cd826a8556b
2009-01-18 22:20:32 +00:00
jens 31bd88a707 - major changes
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@262 cc03376c-175c-47c8-b038-4cd826a8556b
2009-01-18 22:15:12 +00:00
jens 739921d7a9 - rename 'page' to 'bank'
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@261 cc03376c-175c-47c8-b038-4cd826a8556b
2009-01-18 22:14:40 +00:00
jens cfb87bf755 - Minor changes
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@260 cc03376c-175c-47c8-b038-4cd826a8556b
2009-01-18 22:08:26 +00:00
jens 73f7a85646 - added ac97
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@259 cc03376c-175c-47c8-b038-4cd826a8556b
2009-01-18 22:08:13 +00:00
jens 03780653b8 - changes on async_port
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@258 cc03376c-175c-47c8-b038-4cd826a8556b
2009-01-18 22:07:48 +00:00
jens 0dcb62d6ff - put async_types to lib/misc/async_types
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@257 cc03376c-175c-47c8-b038-4cd826a8556b
2009-01-18 22:07:25 +00:00
jens 8534d570e0 - added SEL_I and multiple write-enables on async port
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@256 cc03376c-175c-47c8-b038-4cd826a8556b
2009-01-18 21:44:57 +00:00
jens 60bb979bb7 Initial version
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@255 cc03376c-175c-47c8-b038-4cd826a8556b
2009-01-18 21:44:26 +00:00
jens 5681bf5693 Initial version
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@254 cc03376c-175c-47c8-b038-4cd826a8556b
2009-01-18 14:39:34 +00:00
jens 1a26f8176a - Minor changes
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@253 cc03376c-175c-47c8-b038-4cd826a8556b
2009-01-18 14:39:23 +00:00
jens 9ef46952e2 - added flashgen build
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@252 cc03376c-175c-47c8-b038-4cd826a8556b
2009-01-18 14:39:03 +00:00
jens 06bb5f8f0d - deleted
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@251 cc03376c-175c-47c8-b038-4cd826a8556b
2009-01-18 10:01:07 +00:00
jens 987f426a57 - update
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@249 cc03376c-175c-47c8-b038-4cd826a8556b
2009-01-16 08:40:07 +00:00
jens 6c03c853f6 - renamed bui, icache and dcache
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@248 cc03376c-175c-47c8-b038-4cd826a8556b
2009-01-16 08:34:55 +00:00
jens d63cdf3cb1 - renamed bui to biu
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@247 cc03376c-175c-47c8-b038-4cd826a8556b
2009-01-16 08:33:18 +00:00
jens 4c482f1cda - renamed
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@246 cc03376c-175c-47c8-b038-4cd826a8556b
2009-01-16 08:33:06 +00:00
jens 9f7547c68e - deleted
git-svn-id: http://moon:8086/svn/vhdl/trunk@245 cc03376c-175c-47c8-b038-4cd826a8556b
2009-01-16 07:47:24 +00:00
jens dd6bd675f1 - changed to J-Bus interface
git-svn-id: http://moon:8086/svn/vhdl/trunk@244 cc03376c-175c-47c8-b038-4cd826a8556b
2009-01-15 07:07:51 +00:00
jens c882f1d469 - changed read, write order (should have no effect)
git-svn-id: http://moon:8086/svn/vhdl/trunk@243 cc03376c-175c-47c8-b038-4cd826a8556b
2009-01-14 20:26:29 +00:00
jens 9163ced247 - uses common fixed_pkg
git-svn-id: http://moon:8086/svn/vhdl/trunk@242 cc03376c-175c-47c8-b038-4cd826a8556b
2009-01-14 09:43:36 +00:00
jens 0c8a1c2ec5 - removed reference to mix_pkg
git-svn-id: http://moon:8086/svn/vhdl/trunk@241 cc03376c-175c-47c8-b038-4cd826a8556b
2009-01-14 09:41:01 +00:00
jens f053756416 - deleted
git-svn-id: http://moon:8086/svn/vhdl/trunk@240 cc03376c-175c-47c8-b038-4cd826a8556b
2009-01-14 09:37:07 +00:00
jens 70645de004 - uses common fixed_pkg
git-svn-id: http://moon:8086/svn/vhdl/trunk@239 cc03376c-175c-47c8-b038-4cd826a8556b
2009-01-14 09:36:50 +00:00
jens e91134a95f - uses common fixed_pkg
git-svn-id: http://moon:8086/svn/vhdl/trunk@238 cc03376c-175c-47c8-b038-4cd826a8556b
2009-01-14 09:28:39 +00:00
jens d9030dc07c - removed decimation in m-script (which is done in CFIR)
git-svn-id: http://moon:8086/svn/vhdl/trunk@237 cc03376c-175c-47c8-b038-4cd826a8556b
2009-01-13 10:08:17 +00:00
jens 1417d6f5cd - bugfix 'x_out' register
git-svn-id: http://moon:8086/svn/vhdl/trunk@236 cc03376c-175c-47c8-b038-4cd826a8556b
2009-01-13 09:55:05 +00:00
jens ef9b538769 - fir_stage_sys only uses pipe_latency as parameter
git-svn-id: http://moon:8086/svn/vhdl/trunk@235 cc03376c-175c-47c8-b038-4cd826a8556b
2009-01-13 09:29:45 +00:00
jens 6a1d8f729f Initial version
git-svn-id: http://moon:8086/svn/vhdl/trunk@234 cc03376c-175c-47c8-b038-4cd826a8556b
2009-01-12 10:11:09 +00:00
jens bcefe4639e - removed adding of one bit to cic_stages
git-svn-id: http://moon:8086/svn/vhdl/trunk@233 cc03376c-175c-47c8-b038-4cd826a8556b
2009-01-12 09:56:08 +00:00
jens cf548fd893 - Minor changes
git-svn-id: http://moon:8086/svn/vhdl/trunk@232 cc03376c-175c-47c8-b038-4cd826a8556b
2009-01-11 19:08:23 +00:00
jens 89723cf6d0 - Minor changes
git-svn-id: http://moon:8086/svn/vhdl/trunk@231 cc03376c-175c-47c8-b038-4cd826a8556b
2009-01-11 18:47:33 +00:00
jens 308d0d8f4a - Minor changes
git-svn-id: http://moon:8086/svn/vhdl/trunk@230 cc03376c-175c-47c8-b038-4cd826a8556b
2009-01-11 18:30:36 +00:00
jens 5483606f74 - Minor changes
git-svn-id: http://moon:8086/svn/vhdl/trunk@229 cc03376c-175c-47c8-b038-4cd826a8556b
2009-01-11 18:14:31 +00:00
jens 4e2cb68237 - Minor changes
git-svn-id: http://moon:8086/svn/vhdl/trunk@228 cc03376c-175c-47c8-b038-4cd826a8556b
2009-01-11 17:08:38 +00:00
jens 8d0bb58b5d - Coeff RAMs have no 'ce' for read
git-svn-id: http://moon:8086/svn/vhdl/trunk@227 cc03376c-175c-47c8-b038-4cd826a8556b
2009-01-11 16:58:36 +00:00
jens bce7ba16b7 - Uses decimating CFIR (decimate by 2)
git-svn-id: http://moon:8086/svn/vhdl/trunk@226 cc03376c-175c-47c8-b038-4cd826a8556b
2009-01-11 15:44:07 +00:00
jens 7649b3fff0 deleted
git-svn-id: http://moon:8086/svn/vhdl/trunk@225 cc03376c-175c-47c8-b038-4cd826a8556b
2009-01-11 15:31:42 +00:00
jens 16e7312df1 Initial version
git-svn-id: http://moon:8086/svn/vhdl/trunk@224 cc03376c-175c-47c8-b038-4cd826a8556b
2009-01-11 15:31:32 +00:00
jens dd42e17b18 - decimating is now working
git-svn-id: http://moon:8086/svn/vhdl/trunk@223 cc03376c-175c-47c8-b038-4cd826a8556b
2009-01-11 12:57:26 +00:00
jens 748bd9e52a - removed 'ce'
git-svn-id: http://moon:8086/svn/vhdl/trunk@222 cc03376c-175c-47c8-b038-4cd826a8556b
2009-01-11 12:57:06 +00:00
jens c403b3b22d - Minor changes
git-svn-id: http://moon:8086/svn/vhdl/trunk@221 cc03376c-175c-47c8-b038-4cd826a8556b
2009-01-10 21:16:38 +00:00
jens 9c45912627 - Minor changes
git-svn-id: http://moon:8086/svn/vhdl/trunk@220 cc03376c-175c-47c8-b038-4cd826a8556b
2009-01-10 19:22:25 +00:00
jens 170a65237b - Prepared with FIFO for decimating FIR
git-svn-id: http://moon:8086/svn/vhdl/trunk@219 cc03376c-175c-47c8-b038-4cd826a8556b
2009-01-10 19:22:15 +00:00
jens 937e129a55 - reverted to 1.10
- kept signal 'start' to trigger FIR process


git-svn-id: http://moon:8086/svn/vhdl/trunk@218 cc03376c-175c-47c8-b038-4cd826a8556b
2009-01-10 19:15:23 +00:00
jens d059cf8109 - new signal 'start' to trigger FIR process
use din_vld for data load. This permits decimation FIR filtering


git-svn-id: http://moon:8086/svn/vhdl/trunk@217 cc03376c-175c-47c8-b038-4cd826a8556b
2009-01-10 17:40:32 +00:00
jens ffa4eb81ca - Lowpass prototype: omega is fraction of fs/2
git-svn-id: http://moon:8086/svn/vhdl/trunk@216 cc03376c-175c-47c8-b038-4cd826a8556b
2009-01-10 08:56:38 +00:00
jens 04e1b6fcbf - Cleaned up
git-svn-id: http://moon:8086/svn/vhdl/trunk@215 cc03376c-175c-47c8-b038-4cd826a8556b
2009-01-09 11:50:57 +00:00
jens 8106295641 - added unfiltered output at ddc for eval
git-svn-id: http://moon:8086/svn/vhdl/trunk@214 cc03376c-175c-47c8-b038-4cd826a8556b
2009-01-09 11:50:40 +00:00
jens 5f40d70789 - coef input registered
git-svn-id: http://moon:8086/svn/vhdl/trunk@213 cc03376c-175c-47c8-b038-4cd826a8556b
2009-01-08 10:25:45 +00:00
jens 83a9b4c417 - changed iterative CFIR wirh semi-parallel version
git-svn-id: http://moon:8086/svn/vhdl/trunk@212 cc03376c-175c-47c8-b038-4cd826a8556b
2009-01-06 21:20:29 +00:00
jens a98a8bb0ba - Cleaned up
git-svn-id: http://moon:8086/svn/vhdl/trunk@211 cc03376c-175c-47c8-b038-4cd826a8556b
2009-01-06 21:15:45 +00:00
jens 590734078c - added assertion check for min coef_latency
git-svn-id: http://moon:8086/svn/vhdl/trunk@210 cc03376c-175c-47c8-b038-4cd826a8556b
2009-01-06 10:14:38 +00:00
jens 0ed5461442 - Cleaned up
git-svn-id: http://moon:8086/svn/vhdl/trunk@209 cc03376c-175c-47c8-b038-4cd826a8556b
2009-01-05 10:54:55 +00:00
jens c46a1caaf5 - Minor changes
git-svn-id: http://moon:8086/svn/vhdl/trunk@208 cc03376c-175c-47c8-b038-4cd826a8556b
2009-01-05 10:15:53 +00:00
jens 9c12bc9640 - added RAM-based architecture
git-svn-id: http://moon:8086/svn/vhdl/trunk@207 cc03376c-175c-47c8-b038-4cd826a8556b
2009-01-05 10:06:37 +00:00
jens 90a889a5f8 - use RAM-based delayline
git-svn-id: http://moon:8086/svn/vhdl/trunk@206 cc03376c-175c-47c8-b038-4cd826a8556b
2009-01-05 10:06:14 +00:00
jens 245c01ad45 - fixed missing CE at yout
git-svn-id: http://moon:8086/svn/vhdl/trunk@205 cc03376c-175c-47c8-b038-4cd826a8556b
2009-01-05 09:32:43 +00:00
jens 9832fbfac9 - added dedicated DPRAM for COEFFS
git-svn-id: http://moon:8086/svn/vhdl/trunk@204 cc03376c-175c-47c8-b038-4cd826a8556b
2009-01-05 09:32:27 +00:00
jens 650e5db110 - Minor changes
git-svn-id: http://moon:8086/svn/vhdl/trunk@203 cc03376c-175c-47c8-b038-4cd826a8556b
2009-01-04 16:34:02 +00:00
jens 58257266ad - Minor changes
git-svn-id: http://moon:8086/svn/vhdl/trunk@202 cc03376c-175c-47c8-b038-4cd826a8556b
2009-01-04 16:14:14 +00:00
jens c10463c961 - removed reset from fir_stage_sys
git-svn-id: http://moon:8086/svn/vhdl/trunk@201 cc03376c-175c-47c8-b038-4cd826a8556b
2009-01-04 16:13:58 +00:00
jens e4dc3e69a1 - fixed rdy-signal
git-svn-id: http://moon:8086/svn/vhdl/trunk@200 cc03376c-175c-47c8-b038-4cd826a8556b
2009-01-04 15:31:46 +00:00
jens 9a756d4ca8 - Minor changes
git-svn-id: http://moon:8086/svn/vhdl/trunk@199 cc03376c-175c-47c8-b038-4cd826a8556b
2009-01-04 15:31:20 +00:00
jens f05c6bb829 - input data rate can be lower than filter
git-svn-id: http://moon:8086/svn/vhdl/trunk@198 cc03376c-175c-47c8-b038-4cd826a8556b
2009-01-04 15:16:06 +00:00
jens fe60d9d7a4 - added shift_en input
git-svn-id: http://moon:8086/svn/vhdl/trunk@197 cc03376c-175c-47c8-b038-4cd826a8556b
2009-01-04 15:15:54 +00:00
jens 9675773b2a - added ce
git-svn-id: http://moon:8086/svn/vhdl/trunk@196 cc03376c-175c-47c8-b038-4cd826a8556b
2009-01-04 14:00:06 +00:00
jens 1738a6c0b6 - minor mods to accu_ld_pipe
git-svn-id: http://moon:8086/svn/vhdl/trunk@195 cc03376c-175c-47c8-b038-4cd826a8556b
2009-01-04 13:56:07 +00:00
jens bc4c015150 - minor mods to vld_pipe
git-svn-id: http://moon:8086/svn/vhdl/trunk@194 cc03376c-175c-47c8-b038-4cd826a8556b
2009-01-03 20:33:42 +00:00
jens d28b2225a7 - uses only fir_pkg and filter_pkg for FIR
git-svn-id: http://moon:8086/svn/vhdl/trunk@193 cc03376c-175c-47c8-b038-4cd826a8556b
2009-01-03 20:13:55 +00:00
jens fcdbc0e601 - Intital revision
git-svn-id: http://moon:8086/svn/vhdl/trunk@192 cc03376c-175c-47c8-b038-4cd826a8556b
2009-01-03 20:06:07 +00:00
jens 690c6c24f6 - bug fix coef-pipe
git-svn-id: http://moon:8086/svn/vhdl/trunk@191 cc03376c-175c-47c8-b038-4cd826a8556b
2009-01-03 20:05:04 +00:00
jens ba703d81df - simplification for coef-array
git-svn-id: http://moon:8086/svn/vhdl/trunk@190 cc03376c-175c-47c8-b038-4cd826a8556b
2009-01-02 16:48:36 +00:00
jens 0ed3e397f2 - using fir_stage_sys instead of fir_stage
git-svn-id: http://moon:8086/svn/vhdl/trunk@189 cc03376c-175c-47c8-b038-4cd826a8556b
2009-01-02 16:23:04 +00:00
jens eb818a15bb - added coef_latency
git-svn-id: http://moon:8086/svn/vhdl/trunk@188 cc03376c-175c-47c8-b038-4cd826a8556b
2009-01-02 16:22:28 +00:00
jens a165d37bb7 - added coef_latency
- y_dout registered


git-svn-id: http://moon:8086/svn/vhdl/trunk@187 cc03376c-175c-47c8-b038-4cd826a8556b
2009-01-02 16:22:12 +00:00
jens c574f7f0fd - moved fixed_array_t to fixed_util_pkg
git-svn-id: http://moon:8086/svn/vhdl/trunk@186 cc03376c-175c-47c8-b038-4cd826a8556b
2009-01-02 16:21:11 +00:00
jens a10614df0a - fix ntaps_bits
git-svn-id: http://moon:8086/svn/vhdl/trunk@185 cc03376c-175c-47c8-b038-4cd826a8556b
2009-01-02 16:20:48 +00:00
jens 5f1b2738de - moved real_array_t to fixed_util_pkg
git-svn-id: http://moon:8086/svn/vhdl/trunk@184 cc03376c-175c-47c8-b038-4cd826a8556b
2009-01-02 16:20:21 +00:00
jens d7ed0a9fb0 - added CFIR
git-svn-id: http://moon:8086/svn/vhdl/trunk@183 cc03376c-175c-47c8-b038-4cd826a8556b
2009-01-02 16:19:08 +00:00
jens 655cfb7f0d - Minor changes
git-svn-id: http://moon:8086/svn/vhdl/trunk@182 cc03376c-175c-47c8-b038-4cd826a8556b
2009-01-02 16:18:38 +00:00
jens 55a702d6bd - moved real_array_t to fixed_util_pkg
git-svn-id: http://moon:8086/svn/vhdl/trunk@181 cc03376c-175c-47c8-b038-4cd826a8556b
2009-01-02 16:07:16 +00:00
jens e8ddaf8d98 - added real veriants of NextPower...
git-svn-id: http://moon:8086/svn/vhdl/trunk@180 cc03376c-175c-47c8-b038-4cd826a8556b
2009-01-02 15:28:01 +00:00
jens 377b8c0993 - Intital revision
git-svn-id: http://moon:8086/svn/vhdl/trunk@179 cc03376c-175c-47c8-b038-4cd826a8556b
2008-12-31 15:54:51 +00:00
jens 8c652af1a7 - removed sproto-calls due to crashes in synth tools
git-svn-id: http://moon:8086/svn/vhdl/trunk@178 cc03376c-175c-47c8-b038-4cd826a8556b
2008-12-31 11:23:50 +00:00
jens 18641b8411 - uses ieee_proposed.fixed_pkg
git-svn-id: http://moon:8086/svn/vhdl/trunk@177 cc03376c-175c-47c8-b038-4cd826a8556b
2008-12-30 19:37:56 +00:00
jens dc63b8df76 - Ratio and gain are set at synthesis time (simpler)
git-svn-id: http://moon:8086/svn/vhdl/trunk@176 cc03376c-175c-47c8-b038-4cd826a8556b
2008-12-30 18:56:12 +00:00
jens 7c7fc19162 - Minor changes
git-svn-id: http://moon:8086/svn/vhdl/trunk@175 cc03376c-175c-47c8-b038-4cd826a8556b
2008-12-30 18:54:21 +00:00
jens c11d040f68 - added register after scaler
git-svn-id: http://moon:8086/svn/vhdl/trunk@174 cc03376c-175c-47c8-b038-4cd826a8556b
2008-12-30 06:24:39 +00:00
jens 4cd2e0fd19 - uses ieee_proposed.fixed_pkg
git-svn-id: http://moon:8086/svn/vhdl/trunk@173 cc03376c-175c-47c8-b038-4cd826a8556b
2008-12-30 06:04:19 +00:00
jens 61d5c40cd2 - uses ieee_proposed.fixed_pkg
- din scaled to more fraction precision at integrator input.
  Number of integer bits are the same as din
- min_gain intrduced (reduces complexity of barrel shifter).
 Din always constant scaled by min_gain.


git-svn-id: http://moon:8086/svn/vhdl/trunk@172 cc03376c-175c-47c8-b038-4cd826a8556b
2008-12-30 06:03:56 +00:00
jens 75f8ddd340 - uses ieee_proposed.fixed_pkg
git-svn-id: http://moon:8086/svn/vhdl/trunk@171 cc03376c-175c-47c8-b038-4cd826a8556b
2008-12-30 05:35:51 +00:00
jens 8136d54172 - uses ieee_proposed.fixed_pkg
git-svn-id: http://moon:8086/svn/vhdl/trunk@170 cc03376c-175c-47c8-b038-4cd826a8556b
2008-12-30 05:21:52 +00:00
jens 50e4d2d32a - combine in/out_width to max_width
- uses ieee_proposed.fixed_pkg


git-svn-id: http://moon:8086/svn/vhdl/trunk@169 cc03376c-175c-47c8-b038-4cd826a8556b
2008-12-30 04:39:46 +00:00
jens c45b123bdb - uses ieee_proposed.fixed_pkg
git-svn-id: http://moon:8086/svn/vhdl/trunk@168 cc03376c-175c-47c8-b038-4cd826a8556b
2008-12-30 04:32:32 +00:00
jens 4fe3a1c636 - combine in/out_width to max_width
- uses ieee_proposed.fixed_pkg


git-svn-id: http://moon:8086/svn/vhdl/trunk@167 cc03376c-175c-47c8-b038-4cd826a8556b
2008-12-30 04:32:07 +00:00
jens d9ba866ed0 - Intital revision
git-svn-id: http://moon:8086/svn/vhdl/trunk@166 cc03376c-175c-47c8-b038-4cd826a8556b
2008-12-29 14:05:12 +00:00
jens f7e19d3d44 - Minor changes
git-svn-id: http://moon:8086/svn/vhdl/trunk@165 cc03376c-175c-47c8-b038-4cd826a8556b
2008-12-28 21:43:27 +00:00
jens fb625665d2 - Cleaned up
git-svn-id: http://moon:8086/svn/vhdl/trunk@164 cc03376c-175c-47c8-b038-4cd826a8556b
2008-12-28 19:04:18 +00:00
jens ef5da14068 - uses now fixed_util_pkg for common functions
git-svn-id: http://moon:8086/svn/vhdl/trunk@163 cc03376c-175c-47c8-b038-4cd826a8556b
2008-12-28 16:55:15 +00:00
jens f3c6c4c644 - Cleaned up
git-svn-id: http://moon:8086/svn/vhdl/trunk@162 cc03376c-175c-47c8-b038-4cd826a8556b
2008-12-28 16:49:28 +00:00
jens 64cb0bb426 - uses now fixed_util_pkg for common functions
git-svn-id: http://moon:8086/svn/vhdl/trunk@161 cc03376c-175c-47c8-b038-4cd826a8556b
2008-12-28 16:48:15 +00:00
jens 4735454c40 - moved common functions to fixed_util_pkg
git-svn-id: http://moon:8086/svn/vhdl/trunk@160 cc03376c-175c-47c8-b038-4cd826a8556b
2008-12-28 16:47:54 +00:00
jens 0e4e1b0fba - Minor changes
git-svn-id: http://moon:8086/svn/vhdl/trunk@159 cc03376c-175c-47c8-b038-4cd826a8556b
2008-12-28 16:41:04 +00:00
jens d9961e9efb - use now non-debug-versions (NCO) for TB
git-svn-id: http://moon:8086/svn/vhdl/trunk@158 cc03376c-175c-47c8-b038-4cd826a8556b
2008-12-28 16:35:52 +00:00
jens be85922612 - Cleaned up
git-svn-id: http://moon:8086/svn/vhdl/trunk@157 cc03376c-175c-47c8-b038-4cd826a8556b
2008-12-28 16:35:44 +00:00
jens 1e9bed13e5 - added CIC-decimator
git-svn-id: http://moon:8086/svn/vhdl/trunk@156 cc03376c-175c-47c8-b038-4cd826a8556b
2008-12-28 16:30:56 +00:00
jens 28bd8e959d - use now non-debug-versions (NCO, MIX) for TB
git-svn-id: http://moon:8086/svn/vhdl/trunk@155 cc03376c-175c-47c8-b038-4cd826a8556b
2008-12-28 16:30:28 +00:00
jens 860e2984fd - Cleaned up
git-svn-id: http://moon:8086/svn/vhdl/trunk@154 cc03376c-175c-47c8-b038-4cd826a8556b
2008-12-28 16:29:13 +00:00
jens 13df4bbf12 - added generic for fractional number of bits
git-svn-id: http://moon:8086/svn/vhdl/trunk@153 cc03376c-175c-47c8-b038-4cd826a8556b
2008-12-28 16:29:03 +00:00
jens 9a7ffd09ac - Intital revision
git-svn-id: http://moon:8086/svn/vhdl/trunk@152 cc03376c-175c-47c8-b038-4cd826a8556b
2008-12-28 16:28:38 +00:00
jens 21e3023bfb - added generic for fractional number of bits
git-svn-id: http://moon:8086/svn/vhdl/trunk@151 cc03376c-175c-47c8-b038-4cd826a8556b
2008-12-22 10:44:31 +00:00
jens 2903f5b7f1 - Minor changes
git-svn-id: http://moon:8086/svn/vhdl/trunk@150 cc03376c-175c-47c8-b038-4cd826a8556b
2008-12-22 09:59:41 +00:00
jens 6e65134b53 - added generic for fractional number of bits
git-svn-id: http://moon:8086/svn/vhdl/trunk@149 cc03376c-175c-47c8-b038-4cd826a8556b
2008-12-22 09:57:01 +00:00
jens 4bb7087b60 - added generic for fractional number of bits
git-svn-id: http://moon:8086/svn/vhdl/trunk@148 cc03376c-175c-47c8-b038-4cd826a8556b
2008-12-22 09:39:16 +00:00
jens de9ad2d469 - Minor changes
git-svn-id: http://moon:8086/svn/vhdl/trunk@147 cc03376c-175c-47c8-b038-4cd826a8556b
2008-12-22 09:38:44 +00:00
jens 988b2ed138 - Intital revision
git-svn-id: http://moon:8086/svn/vhdl/trunk@146 cc03376c-175c-47c8-b038-4cd826a8556b
2008-12-21 19:54:37 +00:00
jens 50af9fe70d - Cleaned up
git-svn-id: http://moon:8086/svn/vhdl/trunk@145 cc03376c-175c-47c8-b038-4cd826a8556b
2008-12-21 19:53:00 +00:00
jens bf78b1beef - added debug_mix_t
git-svn-id: http://moon:8086/svn/vhdl/trunk@144 cc03376c-175c-47c8-b038-4cd826a8556b
2008-12-21 19:52:20 +00:00
jens fbee2fe578 - changed z-range default to 1.0
git-svn-id: http://moon:8086/svn/vhdl/trunk@143 cc03376c-175c-47c8-b038-4cd826a8556b
2008-12-21 19:51:42 +00:00
jens 080e286b1c - fixed valid_out signal for gain_corr=disabled
git-svn-id: http://moon:8086/svn/vhdl/trunk@142 cc03376c-175c-47c8-b038-4cd826a8556b
2008-12-21 16:39:05 +00:00
jens 32e4a933b9 - Minor changes
git-svn-id: http://moon:8086/svn/vhdl/trunk@141 cc03376c-175c-47c8-b038-4cd826a8556b
2008-12-21 16:38:05 +00:00
jens 15645ec096 - Minor changes
git-svn-id: http://moon:8086/svn/vhdl/trunk@140 cc03376c-175c-47c8-b038-4cd826a8556b
2008-12-21 16:21:10 +00:00
jens 776094e4b2 - Intital revision
git-svn-id: http://moon:8086/svn/vhdl/trunk@139 cc03376c-175c-47c8-b038-4cd826a8556b
2008-12-21 16:18:22 +00:00
jens 8e6affa627 - renamed
git-svn-id: http://moon:8086/svn/vhdl/trunk@138 cc03376c-175c-47c8-b038-4cd826a8556b
2008-12-21 16:16:09 +00:00
jens 27b1d6a426 - Cleaned up
git-svn-id: http://moon:8086/svn/vhdl/trunk@137 cc03376c-175c-47c8-b038-4cd826a8556b
2008-12-21 16:15:49 +00:00
jens bb5f153651 - reduced lower spur boundary
git-svn-id: http://moon:8086/svn/vhdl/trunk@136 cc03376c-175c-47c8-b038-4cd826a8556b
2008-12-21 16:15:31 +00:00
jens a2e01a7966 - added Tpd to 'dout' for sim
git-svn-id: http://moon:8086/svn/vhdl/trunk@135 cc03376c-175c-47c8-b038-4cd826a8556b
2008-11-05 09:34:56 +00:00
jens b4392a5c7a - added AC-97 controller
git-svn-id: http://moon:8086/svn/vhdl/trunk@134 cc03376c-175c-47c8-b038-4cd826a8556b
2008-11-01 21:52:59 +00:00
jens 5091040c1d - Intital revision
git-svn-id: http://moon:8086/svn/vhdl/trunk@133 cc03376c-175c-47c8-b038-4cd826a8556b
2008-11-01 21:48:26 +00:00
jens 755b318e7a - added AC-97 controller
git-svn-id: http://moon:8086/svn/vhdl/trunk@132 cc03376c-175c-47c8-b038-4cd826a8556b
2008-11-01 21:47:15 +00:00
jens a41b5f572a - Minor changes
git-svn-id: http://moon:8086/svn/vhdl/trunk@131 cc03376c-175c-47c8-b038-4cd826a8556b
2008-10-27 00:00:12 +00:00
jens ba2d02d4e6 - Intital revision
git-svn-id: http://moon:8086/svn/vhdl/trunk@130 cc03376c-175c-47c8-b038-4cd826a8556b
2008-10-26 23:52:49 +00:00
jens a14c98c05f - Cleaned up
git-svn-id: http://moon:8086/svn/vhdl/trunk@129 cc03376c-175c-47c8-b038-4cd826a8556b
2008-10-26 23:36:00 +00:00
jens 529658b710 - fixed some bugs
git-svn-id: http://moon:8086/svn/vhdl/trunk@128 cc03376c-175c-47c8-b038-4cd826a8556b
2008-10-26 23:17:57 +00:00
jens 11129059e7 - Intital revision
git-svn-id: http://moon:8086/svn/vhdl/trunk@127 cc03376c-175c-47c8-b038-4cd826a8556b
2008-10-26 21:30:42 +00:00
jens 1f03bb3d41 - fixed some bugs
git-svn-id: http://moon:8086/svn/vhdl/trunk@126 cc03376c-175c-47c8-b038-4cd826a8556b
2008-10-26 10:04:44 +00:00
jens b0a0e4ae6c - fixed some bugs
git-svn-id: http://moon:8086/svn/vhdl/trunk@125 cc03376c-175c-47c8-b038-4cd826a8556b
2008-10-26 09:57:32 +00:00
jens c10be79075 - fixed some bugs
git-svn-id: http://moon:8086/svn/vhdl/trunk@124 cc03376c-175c-47c8-b038-4cd826a8556b
2008-10-26 09:46:49 +00:00
jens 6b38a0acba - removed delay at color output. Fixes image problems.
git-svn-id: http://moon:8086/svn/vhdl/trunk@123 cc03376c-175c-47c8-b038-4cd826a8556b
2008-10-25 20:11:03 +00:00
jens 84255df928 - Cleaned up
git-svn-id: http://moon:8086/svn/vhdl/trunk@122 cc03376c-175c-47c8-b038-4cd826a8556b
2008-10-25 18:09:39 +00:00
jens 9954268b22 - Minor changes
git-svn-id: http://moon:8086/svn/vhdl/trunk@120 cc03376c-175c-47c8-b038-4cd826a8556b
2008-10-25 17:40:42 +00:00
jens 6597bccd01 - using now dpram_1w1r
git-svn-id: http://moon:8086/svn/vhdl/trunk@119 cc03376c-175c-47c8-b038-4cd826a8556b
2008-10-25 17:26:07 +00:00
jens a6c7859e22 - Cleaned up
git-svn-id: http://moon:8086/svn/vhdl/trunk@118 cc03376c-175c-47c8-b038-4cd826a8556b
2008-10-25 17:23:04 +00:00
jens 1c7fd9022e - Intital revision
git-svn-id: http://moon:8086/svn/vhdl/trunk@117 cc03376c-175c-47c8-b038-4cd826a8556b
2008-10-25 17:20:15 +00:00
jens 5120448104 - using bui-generics for cache sizes
git-svn-id: http://moon:8086/svn/vhdl/trunk@116 cc03376c-175c-47c8-b038-4cd826a8556b
2008-10-25 17:16:21 +00:00
jens 8e41790680 - added generics for cache sizes
git-svn-id: http://moon:8086/svn/vhdl/trunk@115 cc03376c-175c-47c8-b038-4cd826a8556b
2008-10-25 17:16:05 +00:00
jens 08317c7744 - Removed DEADBEEF-garbage
git-svn-id: http://moon:8086/svn/vhdl/trunk@114 cc03376c-175c-47c8-b038-4cd826a8556b
2008-10-25 17:09:13 +00:00
jens 9918af8a12 - Removed dirty-bit which is not needed by Direct-Mapped Cache
git-svn-id: http://moon:8086/svn/vhdl/trunk@113 cc03376c-175c-47c8-b038-4cd826a8556b
2008-10-25 17:08:37 +00:00
jens 8102a16c3c - Removed linefifo
- Uses now lib/FIFO/fifo_async.vhd


git-svn-id: http://moon:8086/svn/vhdl/trunk@112 cc03376c-175c-47c8-b038-4cd826a8556b
2008-10-25 12:27:38 +00:00
jens ed47f478f8 - Switched to 64-Bit SDRAM- and VGA-controller
git-svn-id: http://moon:8086/svn/vhdl/trunk@110 cc03376c-175c-47c8-b038-4cd826a8556b
2008-10-25 11:48:04 +00:00
jens 7cdfa6929d - Intital revision
git-svn-id: http://moon:8086/svn/vhdl/trunk@109 cc03376c-175c-47c8-b038-4cd826a8556b
2008-10-25 11:26:06 +00:00
jens 16b4f2b138 - Bugfix: changed 'ptr_r' from 'bcnt_r' to 'bnxt_r' to prevent read delay when FIFO is read (re = 1)
git-svn-id: http://moon:8086/svn/vhdl/trunk@108 cc03376c-175c-47c8-b038-4cd826a8556b
2008-10-25 11:21:47 +00:00
jens 7ccefbab86 - Removed linefifo
- Uses now lib/FIFO/fifo_async.vhd


git-svn-id: http://moon:8086/svn/vhdl/trunk@107 cc03376c-175c-47c8-b038-4cd826a8556b
2008-10-25 11:15:26 +00:00
jens 5abe0f9234 -Removed linefifo.vhd and dpram.vhd
- Uses now lib/FIFO/fifo_async.vhd


git-svn-id: http://moon:8086/svn/vhdl/trunk@106 cc03376c-175c-47c8-b038-4cd826a8556b
2008-10-25 11:14:50 +00:00
jens 29eb6a05c3 - Cleaned up
git-svn-id: http://moon:8086/svn/vhdl/trunk@105 cc03376c-175c-47c8-b038-4cd826a8556b
2008-10-25 11:11:52 +00:00
jens 2c95fae0ab - Minor changes
git-svn-id: http://moon:8086/svn/vhdl/trunk@104 cc03376c-175c-47c8-b038-4cd826a8556b
2008-10-25 00:23:56 +00:00
jens 545379c99d - added conversion functions unsigned <=> color_t
git-svn-id: http://moon:8086/svn/vhdl/trunk@103 cc03376c-175c-47c8-b038-4cd826a8556b
2008-10-25 00:15:29 +00:00
jens 533a0bd328 - Intital revision
git-svn-id: http://moon:8086/svn/vhdl/trunk@102 cc03376c-175c-47c8-b038-4cd826a8556b
2008-10-24 20:56:28 +00:00
jens b81ce94c39 - Cleaned up
git-svn-id: http://moon:8086/svn/vhdl/trunk@101 cc03376c-175c-47c8-b038-4cd826a8556b
2008-10-24 20:56:13 +00:00
jens 48c7618752 - Minor changes
git-svn-id: http://moon:8086/svn/vhdl/trunk@100 cc03376c-175c-47c8-b038-4cd826a8556b
2008-10-23 22:06:41 +00:00
jens 5c63d629a7 - Cleaned up
git-svn-id: http://moon:8086/svn/vhdl/trunk@99 cc03376c-175c-47c8-b038-4cd826a8556b
2008-10-23 22:06:34 +00:00
jens 36e8cd1e00 - Using MODELSIM_HOME environment variable
git-svn-id: http://moon:8086/svn/vhdl/trunk@98 cc03376c-175c-47c8-b038-4cd826a8556b
2008-10-23 21:21:24 +00:00
jens c90b63d476 - Intital revision
git-svn-id: http://moon:8086/svn/vhdl/trunk@97 cc03376c-175c-47c8-b038-4cd826a8556b
2008-10-23 21:20:28 +00:00
jens 41593cbc54 - Intital revision
git-svn-id: http://moon:8086/svn/vhdl/trunk@96 cc03376c-175c-47c8-b038-4cd826a8556b
2008-10-23 09:49:42 +00:00
jens 0bba7d2e10 - added area constraint for "inst_mips_top"
git-svn-id: http://moon:8086/svn/vhdl/trunk@95 cc03376c-175c-47c8-b038-4cd826a8556b
2008-10-22 09:47:34 +00:00
jens a5f0a35f80 - Minor changes
git-svn-id: http://moon:8086/svn/vhdl/trunk@94 cc03376c-175c-47c8-b038-4cd826a8556b
2008-10-21 19:32:11 +00:00
jens 5bd0c6ea4a - Update
git-svn-id: http://moon:8086/svn/vhdl/trunk@93 cc03376c-175c-47c8-b038-4cd826a8556b
2008-10-21 19:29:57 +00:00
jens 1929d9374e - Removed User ROM stuff
git-svn-id: http://moon:8086/svn/vhdl/trunk@92 cc03376c-175c-47c8-b038-4cd826a8556b
2008-10-21 18:52:14 +00:00
jens c9900e509a - Loading app from Flash instead User ROM
- Removed User ROM


git-svn-id: http://moon:8086/svn/vhdl/trunk@91 cc03376c-175c-47c8-b038-4cd826a8556b
2008-10-21 18:24:56 +00:00
jens 029bf8eb22 - changed some directories
git-svn-id: http://moon:8086/svn/vhdl/trunk@90 cc03376c-175c-47c8-b038-4cd826a8556b
2008-10-21 18:24:03 +00:00
jens 8060efb864 - Minor changes
git-svn-id: http://moon:8086/svn/vhdl/trunk@89 cc03376c-175c-47c8-b038-4cd826a8556b
2008-10-21 18:23:29 +00:00
jens 3f62f79d12 - Intital revision
git-svn-id: http://moon:8086/svn/vhdl/trunk@88 cc03376c-175c-47c8-b038-4cd826a8556b
2008-10-21 17:23:58 +00:00
jens fdc3664187 Minor changes
git-svn-id: http://moon:8086/svn/vhdl/trunk@87 cc03376c-175c-47c8-b038-4cd826a8556b
2008-10-20 19:26:51 +00:00
jens 69697d7222 - Intital revision
git-svn-id: http://moon:8086/svn/vhdl/trunk@86 cc03376c-175c-47c8-b038-4cd826a8556b
2008-10-20 19:26:01 +00:00
jens 419ccc4edf Minor changes
git-svn-id: http://moon:8086/svn/vhdl/trunk@85 cc03376c-175c-47c8-b038-4cd826a8556b
2008-10-20 19:11:30 +00:00
jens b67911c65d - added TM_NET for DDR-clock
git-svn-id: http://moon:8086/svn/vhdl/trunk@84 cc03376c-175c-47c8-b038-4cd826a8556b
2008-10-20 09:55:32 +00:00
jens e9e132b3e6 - Cleaned up
git-svn-id: http://moon:8086/svn/vhdl/trunk@83 cc03376c-175c-47c8-b038-4cd826a8556b
2008-10-19 21:53:51 +00:00
jens 32cbb4fc13 - Cleaned up
git-svn-id: http://moon:8086/svn/vhdl/trunk@82 cc03376c-175c-47c8-b038-4cd826a8556b
2008-10-19 21:29:45 +00:00
jens 9e404bfb06 - Intital revision
git-svn-id: http://moon:8086/svn/vhdl/trunk@81 cc03376c-175c-47c8-b038-4cd826a8556b
2008-10-19 21:12:34 +00:00
jens 0ea7ced5e3 - Removed linefifo and clockgen (=> frontend and top)
git-svn-id: http://moon:8086/svn/vhdl/trunk@80 cc03376c-175c-47c8-b038-4cd826a8556b
2008-10-19 21:11:46 +00:00
jens de0a8c6e17 Minor changes
git-svn-id: http://moon:8086/svn/vhdl/trunk@79 cc03376c-175c-47c8-b038-4cd826a8556b
2008-10-19 21:10:51 +00:00
jens f59e4dd7d1 - Added Sync. SRAM
git-svn-id: http://moon:8086/svn/vhdl/trunk@78 cc03376c-175c-47c8-b038-4cd826a8556b
2008-10-19 20:23:27 +00:00
jens 85bf744892 - Intital revision
git-svn-id: http://moon:8086/svn/vhdl/trunk@77 cc03376c-175c-47c8-b038-4cd826a8556b
2008-10-19 20:13:28 +00:00
jens 891e764a23 - Added VGA
git-svn-id: http://moon:8086/svn/vhdl/trunk@76 cc03376c-175c-47c8-b038-4cd826a8556b
2008-10-19 20:03:28 +00:00
jens 20b3bfb41b - Added Sync. SRAM
git-svn-id: http://moon:8086/svn/vhdl/trunk@75 cc03376c-175c-47c8-b038-4cd826a8556b
2008-10-19 20:02:45 +00:00
jens 8a8adce98e - using now 64-bit SDR interface (2 SDRAMS)
git-svn-id: http://moon:8086/svn/vhdl/trunk@74 cc03376c-175c-47c8-b038-4cd826a8556b
2008-10-18 13:31:15 +00:00
jens 051b4182f1 - Cleaned up
git-svn-id: http://moon:8086/svn/vhdl/trunk@73 cc03376c-175c-47c8-b038-4cd826a8556b
2008-10-18 12:49:30 +00:00
jens 3685973be8 - using now 64-bit SDR interface (2 SDRAMS)
git-svn-id: http://moon:8086/svn/vhdl/trunk@72 cc03376c-175c-47c8-b038-4cd826a8556b
2008-10-18 11:37:01 +00:00
jens b656e2890b Minor changes
git-svn-id: http://moon:8086/svn/vhdl/trunk@71 cc03376c-175c-47c8-b038-4cd826a8556b
2008-10-18 11:36:33 +00:00
jens f50a47246a - introduced per-bank activation (avoids multiple activations on same bank)
- some other improvements


git-svn-id: http://moon:8086/svn/vhdl/trunk@70 cc03376c-175c-47c8-b038-4cd826a8556b
2008-10-18 11:36:07 +00:00
537 changed files with 59544 additions and 104406 deletions
-56
View File
@@ -1,56 +0,0 @@
; -------------------------------------------------
; PROJECT "dctest"
; -------------------------------------------------
include "../../../jasm/cregs.inc.jsm"
; -------------------------------------------------
xmem
org 4
konst: dc 0x01, 0x12,"A"
gap1: db 16
mesg: dc "Hallo", 13,0x0A, 0
name: dc "Jens",0
msg1: dc "Welcome to JASM CPU",0
msg2: dc "Ready",0
msg3: dc "Testing",0
msg4: dc "Passed",0
msg5: dc "Error",0
crlf: dc 0x0D, 0x0A
org 0x00
shit: db 4
cmem 0
org 8
cram1: db 16
cram2: db 6
cram3: db 4
cmem 1
cram4: db 8
cram5: db 8
org 0x20
cram6: db 8
cram7: db 4
reg_revision: equ 0x00
reg_testid: equ 0x01
; -------------------------------------------------
code
org 0x000
reset: jmp start
; -------------------------------------------------
org 0x001
int_vec: jmp isr
; -------------------------------------------------
org 0x010
start: jmp start
; -------------------------------------------------
isr: reti
-212
View File
@@ -1,212 +0,0 @@
# ----------------------------------------------------------------------
# Project: JCPU, a portable 8-bit RISC CPU written in VHDL
# This file: The ROM file for upload to target over JTAG
#
# Copyright (C) 2007 J. Ahrensfeld
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# For questions and ideas, please contact the author at jens@jayfield.org
#
# ---------------------------------------------------------------------
# ---------------------------------------------------------------------
# For Chipscope 9.1
# ---------------------------------------------------------------------
# Source JTAG/TCL frame work
cd $env(CHIPSCOPE)\\bin\\nt
source csejtag.tcl
namespace import ::chipscope::*
# Platform USB Cable
set PLATFORM_USB_CABLE_ARGS [list "port=USB2" "frequency=6000000"]
# frequency="24000000 | 12000000 | 6000000 | 3000000 | 1500000 | 750000"
# Create session
set handle [::chipscope::csejtag_session create 0]
# Open JTAG and lock
set open_result [::chipscope::csejtag_target open $handle $CSEJTAG_TARGET_PLATFORMUSB 0 $PLATFORM_USB_CABLE_ARGS]
set lock_result [::chipscope::csejtag_target lock $handle 1000]
set devlist [::chipscope::csejtag_tap autodetect_chain $handle $CSEJTAG_SCAN_DEFAULT]
# Get Device ID
set devtype "Virtex-4SX"
set devid 2
set irlength [::chipscope::csejtag_tap get_irlength $handle $devid]
set idcode [::chipscope::csejtag_tap get_device_idcode $handle $devid]
set CSE_OP $CSEJTAG_SHIFT_READWRITE
set CSE_ES $CSEJTAG_RUN_TEST_IDLE
# Write Program
# JASM_ROM_INSERT_HERE
# Assembled from dctest.jsm
# ---------------------------------------------------------------
# Shift the USER2 Instruction (b1111000010) into the Instruction Register of FPGA
# User 1
set result [::chipscope::csejtag_tap shift_device_ir $handle $devid $CSE_OP $CSE_ES 0 $irlength "3C2"]
# 0x000: JMP 0x010
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "00030010"
# 0x001: JMP 0x011
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "00130011"
# 0x002:
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "00200000"
# 0x003:
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "00300000"
# 0x004:
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "00400000"
# 0x005:
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "00500000"
# 0x006:
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "00600000"
# 0x007:
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "00700000"
# 0x008:
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "00800000"
# 0x009:
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "00900000"
# 0x00A:
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "00A00000"
# 0x00B:
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "00B00000"
# 0x00C:
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "00C00000"
# 0x00D:
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "00D00000"
# 0x00E:
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "00E00000"
# 0x00F:
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "00F00000"
# 0x010: JMP 0x010
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "01030010"
# 0x011: RETI
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "0113F000"
# Assembled from dctest.jsm
# ---------------------------------------------------------------
# Shift the USER2 Instruction (b1111000011) into the Instruction Register of FPGA
# User 2
set result [::chipscope::csejtag_tap shift_device_ir $handle $devid $CSE_OP $CSE_ES 0 $irlength "3C3"]
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "0000"
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "0100"
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "0200"
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "0300"
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "0401"
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "0512"
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "0641"
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "0700"
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "0800"
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "0900"
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "0A00"
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "0B00"
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "0C00"
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "0D00"
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "0E00"
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "0F00"
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "1000"
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "1100"
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "1200"
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "1300"
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "1400"
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "1500"
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "1600"
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "1748"
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "1861"
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "196C"
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "1A6C"
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "1B6F"
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "1C0D"
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "1D0A"
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "1E00"
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "1F4A"
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "2065"
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "216E"
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "2273"
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "2300"
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "2457"
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "2565"
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "266C"
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "2763"
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "286F"
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "296D"
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "2A65"
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "2B20"
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "2C74"
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "2D6F"
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "2E20"
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "2F4A"
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "3041"
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "3153"
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "324D"
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "3320"
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "3443"
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "3550"
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "3655"
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "3700"
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "3852"
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "3965"
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "3A61"
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "3B64"
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "3C79"
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "3D00"
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "3E54"
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "3F65"
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "4073"
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "4174"
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "4269"
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "436E"
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "4467"
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "4500"
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "4650"
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "4761"
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "4873"
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "4973"
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "4A65"
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "4B64"
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "4C00"
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "4D45"
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "4E72"
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "4F72"
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "506F"
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "5172"
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "5200"
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "530D"
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "540A"
::chipscope::csejtag_target unlock $handle
::chipscope::csejtag_target close $handle
::chipscope::csejtag_session destroy $handle
exit
-858
View File
@@ -1,858 +0,0 @@
; -------------------------------------------------
; PROJECT "itest"
; -------------------------------------------------
include "../../../jasm/cregs.inc.jsm"
; -------------------------------------------------
xmem
msg: dc "Hallo", 0
xram: db 256
cmem 0
cram: db 256
reg_revision: equ 0x00
reg_testid: equ 0x01
; -------------------------------------------------
code
org 0x000
reset: jmp start
; -------------------------------------------------
org 0x001
int_vec: jmp isr
; -------------------------------------------------
org 0x010
start: call init
cin R0, (cpu_revision)
xout (reg_revision), R0
; Test 0
call test0
; Test 1
mov R0, 1
xout (reg_testid), R0
call test1
; Test 2
mov R0, 2
xout (reg_testid), R0
call test2
; Test 3
mov R0, 3
xout (reg_testid), R0
call test3
; Test 4
mov R0, 4
xout (reg_testid), R0
call test4
; Test 5
mov R0, 5
xout (reg_testid), R0
call test5
; Test 6
mov R0, 6
xout (reg_testid), R0
call test6
; Test 7
mov R0, 7
xout (reg_testid), R0
call test7
; Test 8
mov R0, 8
xout (reg_testid), R0
call test8
; Test 9
mov R0, 9
xout (reg_testid), R0
call test9
; Test 10
mov R0, 10
xout (reg_testid), R0
call test10
; Test 11
mov R0, 11
xout (reg_testid), R0
call test11
; Test 12
mov R0, 12
xout (reg_testid), R0
call test12
; End of test
mov R0, 0xFF
xout (reg_testid), R0
jmp ok
; -------------------------------------------------
init: mov R0, 0
mov R1, 0
mov R2, 0
mov R3, 0
mov R4, 0
mov R5, 0
mov R6, 0
mov R7, 0
mov R8, 0
mov R9, 0
mov R10, 0
mov R11, 0
mov R12, 0
mov R13, 0
mov R14, 0
mov R15, 0
ret
; -------------------------------------------------
; MOV|R|K
; MOV|R|R
test0: mov R0, 0x10
cmp R0, 0x10
jne error
add R0, 1
mov R1, R0
cmp R1, 0x11
jne error
add R1, 1
mov R2, R1
cmp R2, 0x12
jne error
add R2, 1
mov R3, R2
cmp R3, 0x13
jne error
add R3, 1
mov R4, R3
cmp R4, 0x14
jne error
add R4, 1
mov R5, R4
cmp R5, 0x15
jne error
add R5, 1
mov R6, R5
cmp R6, 0x16
jne error
add R6, 1
mov R7, R6
cmp R7, 0x17
jne error
add R7, 1
mov R8, R7
cmp R8, 0x18
jne error
add R8, 1
mov R9, R8
cmp R9, 0x19
jne error
add R9, 1
mov R10, R9
cmp R10, 0x1A
jne error
add R10, 1
mov R11, R10
cmp R11, 0x1B
jne error
add R11, 1
mov R12, R11
cmp R12, 0x1C
jne error
add R12, 1
mov R13, R12
cmp R13, 0x1D
jne error
add R13, 1
mov R14, R13
cmp R14, 0x1E
jne error
add R14, 1
mov R15, R14
cmp R15, 0x1F
jne error
add R15, 1
ret
; -------------------------------------------------
; Instruction test
; TST|R
; CMP|R|K
; JNZ|K
; JC|K
; JNE|K
; JLT|K
; JGT|K
; JLE|K
; JGE|K
; JMP|K
test1: mov R0, 0 ; R0 <= 0
tst R0
jnz error
jc error
cmp R0, 0
jne error
jlt error
jgt error
jle t1_ok10
jmp error
t1_ok10: jeq t1_ok20
jmp error
t1_ok20: jge t1_ok30
jmp error
t1_ok30: cmp R0, 0x55
jeq error
jlt t1_ok40
jmp error
t1_ok40: jle t1_ok50
jmp error
t1_ok50: jge error
jgt error
mov R0, 0x55 ; R0 <= 0xAA
tst R0
jz error
jc error
cmp R0, 0xAA
jeq error
jne t1_ok60
jmp error
t1_ok60: jlt t1_ok70
jmp error
t1_ok70: jle t1_ok80
jmp error
t1_ok80: jgt error
cmp R0, 0x55
jeq t1_ok90
jmp error
t1_ok90: jne error
jlt error
jle t1_ok100
jmp error
t1_ok100: jgt error
jge t1_ok110
jmp error
t1_ok110: mov R0, 0xAA ; R0 <= 0x55
tst R0
jz error
jc error
cmp R0, 0x55
jeq error
jne t1_ok120
jmp error
t1_ok120: jgt t1_ok130
jmp error
t1_ok130: jge t1_ok140
jmp error
t1_ok140: jlt error
jle error
ret
; -------------------------------------------------
; ADD|R|K
; ADDC|R|K
; ToDo: ADD|R|R
; ToDo: ADDC|R|R
; CMP|R|R
test2: mov R0, 0
mov R1, 0
mov R2, R0
mov R3, R1
t2_loop: add R0, 0x01
addc R1, 0x00
add R2, 1
cmp R2, 0
jne t2_L1
add R3, 1
cmp R3, 0x02
t2_L1: jne t2_loop
cmp R0, R2
jne error
cmp R1, R3
jne error
mov R0, 0
ret
; -------------------------------------------------
; SUB|R|K
; SUBC|R|K
; ToDo: SUB|R|R
; ToDo: SUBC|R|R
; CMP|R|R
test3: mov R0, 0x00
mov R1, 0x03
mov R2, R0
mov R3, R1
t3_loop: sub R0, 0x01
subc R1, 0x00
sub R2, 1
cmp R2, 0xFF
jne t3_L1
sub R3, 1
cmp R3, 0x00
t3_L1: jne t3_loop
cmp R0, R2
jne error
cmp R1, R3
jne error
mov R0, 0
ret
; -------------------------------------------------
; SUB|K|R
; SUB|R|R
; SUBC|R|R
; SUBC|K|R
; CMP|R|R
test4: mov R0, 0x03
mov R1, 0x05
sub 0x05, R0
sub R1, 0x03
cmp R0, R1
jne error
mov R0, 0x03
mov R1, 0x05
sub R0, R1
subc 0, R0
cmp R0, 0x01
jne error
add R0, 0
subc R1, R0
cmp R1, 0x04
jne error
mov R0, 0
ret
; -------------------------------------------------
; MOVC|R|Ri
; MOVC|R|Ki
; MOVC|Ri|R
; MOVC|Ri|K
; MOVC|Ki|R
test5: mov R0, 1
movc (cram+0x5A), R0
dec R0
movc (cram+0), R0
movc R1, (cram+0x5A)
movc (R1), 0xA5
movc R0, (R1)
movc R1, (R1)
add R1, 0xFF-0xA5
movc R0, (R1)
t5_loop1: movc (R0), R0
movc R2, (R0)
cmp R2, R0
jne error
movc (R2), R1
movc R2, (R2)
cmp R2, R1
jne error
dec R1
inc R0
jnz t5_loop1
ret
; -------------------------------------------------
; MOVX|R|Ri
; MOVX|R|Ki
; MOVX|Ri|R
; MOVX|Ri|K
; MOVX|Ki|R
test6: mov R0, 1
movx (xram+0x5A), R0
dec R0
movx (xram+0), R0
movx R1, (xram+0x5A)
movx (R1), 0xA5
movx R0, (R1)
movx R1, (R1)
add R1, 0xFF-0xA5
movx R0, (R1)
t6_loop1: movx (R0), R0
movx R2, (R0)
cmp R2, R0
jne error
movx (R2), R1
movx R2, (R2)
cmp R2, R1
jne error
dec R1
inc R0
jnz t6_loop1
ret
; -------------------------------------------------
; PUSH|R
; POP|R
test7: mov R0, 0xAA
mov R1, 0
t7_loop1: push R0
inc R0
dec R1
jnz t7_loop1
t7_loop2: pop R0
dec R1
jnz t7_loop2
cmp R0, 0xAA
jne error
ret
; -------------------------------------------------
; JMP|K
; CALL|K
; RET
test8: mov R0, 0x55
push R0
mov R0, 0
mov R1, 0xFF
call t8_rec
pop R0
cmp R0, 0x55
jne error
; Stack manipulations 1
mov R0, return1'high
mov R1, return1'low
cout (cpu_stack_high), R0
push R1
mov R0, init'high
mov R1, init'low
cout (cpu_stack_high), R0
push R1
ret
; Stack manipulations 2
return1: mov R0, return2'high
mov R1, return2'low
cout (cpu_stack_high), R0
push R1
mov R0, init'high
mov R1, init'low
cout (cpu_stack_high), R0
push R1
return2: ret
t8_rec: cmp R0, R1
jeq ex_t8_rec
inc R0
jmp t8_rstub
ex_t8_rec: dec R0
dec R1
ret
t8_rstub: call t8_rec
jmp ex_t8_rec
; -------------------------------------------------
; SWAP|R
; SHL|R
; SHR|R
; ROL|R
; ROR|R
; ROLC|R
; RORC|R
test9: mov R0, 0xA5 ; SWAP test
mov R1, 0x5A
swap R0
cmp R0, 0x5A
jne error
swap R0
cmp R0, 0xA5
jne error
mov R0, 0xD2
swap R0
cmp R0, 0x2D
jne error
swap R1
cmp R0, 0x2D
jne error
cmp R1, 0xA5
jne error
mov R0, 0x2D
shl R0 ; SHL test
cmp R0, 0x5A
jne error
shl R0
cmp R0, 0xB4
jne error
shl R0
cmp R0, 0x68
jne error
shl R0
cmp R0, 0xD0
jne error
shl R0
cmp R0, 0xA0
jne error
shl R0
cmp R0, 0x40
jne error
shl R0
cmp R0, 0x80
jne error
shl R0
cmp R0, 0x00
jne error
mov R1, 0x84
shr R1 ; SHR test
cmp R1, 0x42
jne error
shr R1
cmp R1, 0x21
jne error
shr R1
cmp R1, 0x10
jne error
shr R1
cmp R1, 0x08
jne error
shr R1
cmp R1, 0x04
jne error
shr R1
cmp R1, 0x02
jne error
shr R1
cmp R1, 0x01
jne error
shr R1
cmp R1, 0x00
jne error
mov R0, 0xC5 ; ROL test
rol R0
cmp R0, 0x8B
jne error
rol R0
cmp R0, 0x17
jne error
rol R0
cmp R0, 0x2E
jne error
rol R0
cmp R0, 0x5C
jne error
rol R0
cmp R0, 0xB8
jne error
rol R0
cmp R0, 0x71
jne error
rol R0
cmp R0, 0xE2
jne error
rol R0
cmp R0, 0xC5
jne error
mov R1, 0x63 ; ROR test
ror R1
cmp R1, 0xB1
jne error
ror R1
cmp R1, 0xD8
jne error
ror R1
cmp R1, 0x6C
jne error
ror R1
cmp R1, 0x36
jne error
ror R1
cmp R1, 0x1B
jne error
ror R1
cmp R1, 0x8D
jne error
ror R1
cmp R1, 0xC6
jne error
ror R1
cmp R1, 0x63
jne error
xor R0, R0 ; ROLC generate
mov R0, 0xC5
rolc R0
push R0
rolc R0
push R0
rolc R0
push R0
rolc R0
push R0
rolc R0
push R0
rolc R0
push R0
rolc R0
push R0
rolc R0
push R0
rolc R0
cmp R0, 0xC5 ; ROLC verify
jne error
pop R0
cmp R0, 0x62
jne error
pop R0
cmp R0, 0xB1
jne error
pop R0
cmp R0, 0x58
jne error
pop R0
cmp R0, 0xAC
jne error
pop R0
cmp R0, 0x56
jne error
pop R0
cmp R0, 0x2B
jne error
pop R0
cmp R0, 0x15
jne error
pop R0
cmp R0, 0x8A
jne error
xor R1, R1 ; RORC generate
mov R1, 0x63
rorc R1
push R1
rorc R1
push R1
rorc R1
push R1
rorc R1
push R1
rorc R1
push R1
rorc R1
push R1
rorc R1
push R1
rorc R1
push R1
rorc R1
cmp R1, 0x63 ; RORC verify
jne error
pop R1
cmp R1, 0xC6
jne error
pop R1
cmp R1, 0x8C
jne error
pop R1
cmp R1, 0x19
jne error
pop R1
cmp R1, 0x33
jne error
pop R1
cmp R1, 0x66
jne error
pop R1
cmp R1, 0xCC
jne error
pop R1
cmp R1, 0x98
jne error
pop R1
cmp R1, 0x31
jne error
ret
; -------------------------------------------------
; AND|R|R
; AND|R|K
; OR|R|R
; OR|R|K
; XOR|R|R
; XOR|R|K
test10: mov R0, 0xA5 ; AND
swap R0
push R0
and R0, 0x0F
cmp R0, 0x0A
jne error
pop R0
push R0
and R0, 0x0F
cmp R0, 0x0A
pop R1
jne error
swap R1
mov R2, 0x0F
and R1, R2
cmp R1, 0x05
jne error
mov R0, 0x05 ; OR
mov R2, 0xA0
swap R0
or R2, R0
cmp R2, 0xF0
jne error
swap R0
or R0, 0x50
cmp R0, 0x55
jne error
mov R1, 0x01
mov R0, 0x01
xor R0, 0x01
jnz error
xor R0, R1
cmp R0, 0x01
jne error
ret
; -------------------------------------------------
test11:
mov R0, 0x03
cout (cpu_int_ctrl), R0
xin R0, (2)
or R0, 1
xout (2), R0
nop
nop
nop
nop
nop
nop
xin R0, (2)
and R0, 0xFE
xout (2), R0
nop
nop
nop
nop
cin R0, (cpu_int_ctrl)
or R0, 0x80
cout (cpu_int_ctrl), R0
nop
cin R0, (cpu_int_ctrl)
or R0, 0x80
cout (cpu_int_ctrl), R0
nop
cin R0, (cpu_int_ctrl)
or R0, 0x80
cout (cpu_int_ctrl), R0
nop
cin R0, (cpu_int_ctrl)
or R0, 0x80
cout (cpu_int_ctrl), R0
nop
nop
nop
nop
nop
nop
nop
nop
nop
ret
; -------------------------------------------------
; Tests clrc, setc
test12: sub R0, 0
jc error
setc
jnc error
nop
sub R0, 0
jc error
mov R0, 0
clrc
jc error
setc
jnc error
nop
clrc
jc error
ret
; -------------------------------------------------
isr: inc R14
reti
; -------------------------------------------------
org 0x3FF
error: jmp error
; -------------------------------------------------
org 0x2FF
ok: jmp ok
; -------------------------------------------------
File diff suppressed because it is too large Load Diff
-50
View File
@@ -1,50 +0,0 @@
#!/bin/sh
# ----------------------------------------------------------------------
# Project: JCPU, a portable 8-bit RISC CPU written in VHDL
# This file: rom-file generation for cpu_core
#
# Copyright (C) 2007 J. Ahrensfeld
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# For questions and ideas, please contact the author at jens@jayfield.org
#
# ---------------------------------------------------------------------
TARGET=$2
DSTDIR=$1
JASM_HOME=/cygdrive/w/vhdl/lib/CPUs/JCpu/tools
$JASM_HOME/jasm.rb $TARGET.jsm
irom_tcl_snippet="$TARGET.irom.tcl.snip"
irom_vhdl_snippet="$TARGET.irom.vhdl.snip"
irom_ld_vhdl_snippet="$TARGET.irom_ld.vhdl.snip"
xrom_tcl_snippet="$TARGET.xrom.tcl.snip"
xrom_vhdl_snippet="$TARGET.xrom.vhdl.snip"
xrom_ld_vhdl_snippet="$TARGET.xrom_ld.vhdl.snip"
$JASM_HOME/insrom.rb $irom_vhdl_snippet $JASM_HOME/irom.vhd.tpl >$DSTDIR/$TARGET\_irom.vhdl
$JASM_HOME/insrom.rb $irom_ld_vhdl_snippet $JASM_HOME/irom_ld.vhd.tpl >$DSTDIR/$TARGET\_irom_ld.vhdl
$JASM_HOME/insrom.rb $xrom_vhdl_snippet $JASM_HOME/xrom.vhd.tpl >$DSTDIR/$TARGET\_xrom.vhdl
$JASM_HOME/insrom.rb $xrom_ld_vhdl_snippet $JASM_HOME/xrom_ld.vhd.tpl >$DSTDIR/$TARGET\_xrom_ld.vhdl
cat $irom_tcl_snippet > $TARGET.tcl.snip.snip
cat $xrom_tcl_snippet >> $TARGET.tcl.snip.snip
$JASM_HOME/insrom.rb $TARGET.tcl.snip.snip $JASM_HOME/rom.tcl.tpl >$TARGET.tcl
rm -f *.snip
-29
View File
@@ -1,29 +0,0 @@
; -------------------------------------------------
; Constants
; -------------------------------------------------
; Chip register
include "../../../jasm/cregs.inc.jsm"
; -------------------------------------------------
; Program
; -------------------------------------------------
code
org 0x000
reset: jmp init
; -------------------------------------------------
; Main
; -------------------------------------------------
init: mov R0, 0x45
mov R1, 0xF5
call mul8x8
stop: jmp stop
; -------------------------------------------------
include "../../../jasm/mul8x8.inc.jsm"
-154
View File
@@ -1,154 +0,0 @@
# ----------------------------------------------------------------------
# Project: JCPU, a portable 8-bit RISC CPU written in VHDL
# This file: The ROM file for upload to target over JTAG
#
# Copyright (C) 2007 J. Ahrensfeld
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# For questions and ideas, please contact the author at jens@jayfield.org
#
# ---------------------------------------------------------------------
# ---------------------------------------------------------------------
# For Chipscope 9.1
# ---------------------------------------------------------------------
# Source JTAG/TCL frame work
cd $env(CHIPSCOPE)\\bin\\nt
source csejtag.tcl
namespace import ::chipscope::*
# Platform USB Cable
set PLATFORM_USB_CABLE_ARGS [list "port=USB2" "frequency=6000000"]
# frequency="24000000 | 12000000 | 6000000 | 3000000 | 1500000 | 750000"
# Create session
set handle [::chipscope::csejtag_session create 0]
# Open JTAG and lock
set open_result [::chipscope::csejtag_target open $handle $CSEJTAG_TARGET_PLATFORMUSB 0 $PLATFORM_USB_CABLE_ARGS]
set lock_result [::chipscope::csejtag_target lock $handle 1000]
set devlist [::chipscope::csejtag_tap autodetect_chain $handle $CSEJTAG_SCAN_DEFAULT]
# Get Device ID
set devtype "Virtex-4SX"
set devid 2
set irlength [::chipscope::csejtag_tap get_irlength $handle $devid]
set idcode [::chipscope::csejtag_tap get_device_idcode $handle $devid]
set CSE_OP $CSEJTAG_SHIFT_READWRITE
set CSE_ES $CSEJTAG_RUN_TEST_IDLE
# Write Program
# JASM_ROM_INSERT_HERE
# Assembled from mul8x8.jsm
# ---------------------------------------------------------------
# Shift the USER2 Instruction (b1111000010) into the Instruction Register of FPGA
# User 1
set result [::chipscope::csejtag_tap shift_device_ir $handle $devid $CSE_OP $CSE_ES 0 $irlength "3C2"]
# 0x000: JMP 0x001
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "00030001"
# 0x001: MOV R00, 0x45
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "00103450"
# 0x002: MOV R01, 0xF5
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "00203F51"
# 0x003: CALL 0x005
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "0033B005"
# 0x004: JMP 0x004
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "00430004"
# 0x005: PUSH R02
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "0053C002"
# 0x006: PUSH R03
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "0063C003"
# 0x007: PUSH R04
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "0073C004"
# 0x008: MOV R04, R01
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "00802014"
# 0x009: MOV R01, 0x00
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "00903001"
# 0x00A: MOV R02, 0x00
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "00A03002"
# 0x00B: MOV R03, 0x00
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "00B03003"
# 0x00C: CMP R04, 0x01
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "00C0F014"
# 0x00D: JEQ 0x015
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "00D39015"
# 0x00E: SHR R04
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "00E1F004"
# 0x00F: JNC 0x012
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "00F34012"
# 0x010: ADD R02, R00
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "01010002"
# 0x011: ADDC R03, R01
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "01112013"
# 0x012: SHL R00
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "0121E000"
# 0x013: ROLC R01
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "01322001"
# 0x014: JMP 0x00C
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "0143000C"
# 0x015: ADD R00, R02
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "01510020"
# 0x016: ADDC R01, R03
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "01612031"
# 0x017: POP R04
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "0173D004"
# 0x018: POP R03
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "0183D003"
# 0x019: POP R02
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "0193D002"
# 0x01A: RET
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "01A3E000"
# Assembled from mul8x8.jsm
# ---------------------------------------------------------------
# Shift the USER2 Instruction (b1111000011) into the Instruction Register of FPGA
# User 2
set result [::chipscope::csejtag_tap shift_device_ir $handle $devid $CSE_OP $CSE_ES 0 $irlength "3C3"]
::chipscope::csejtag_target unlock $handle
::chipscope::csejtag_target close $handle
::chipscope::csejtag_session destroy $handle
exit
-50
View File
@@ -1,50 +0,0 @@
; -------------------------------------------------
; Constants
; -------------------------------------------------
; Chip register
cpu_revision: equ 0x00 ; RO
cpu_control: equ 0x01 ; R/W
cpu_status: equ 0x02 ; RO
cpu_int_ctrl: equ 0x03 ; R/W
; -------------------------------------------------
; Program
; -------------------------------------------------
code
reset: jmp init
org 0x001
; nop
reti
; -------------------------------------------------
; Main
; -------------------------------------------------
init: mov R0, 0x05
cout (cpu_int_ctrl), R0
mov R0, 0x00
loop: nop
inc R0
nop
call subr
nop
push R3
nop
push R2
nop
push R1
nop
push R0
nop
pop R0
nop
pop R1
nop
pop R2
nop
pop R3
nop
jmp loop
subr: ret
-157
View File
@@ -1,157 +0,0 @@
# ----------------------------------------------------------------------
# Project: JCPU, a portable 8-bit RISC CPU written in VHDL
# This file: The ROM file for upload to target over JTAG
#
# Copyright (C) 2007 J. Ahrensfeld
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# For questions and ideas, please contact the author at jens@jayfield.org
#
# ---------------------------------------------------------------------
# ---------------------------------------------------------------------
# For Chipscope 9.1
# ---------------------------------------------------------------------
# Source JTAG/TCL frame work
cd $env(CHIPSCOPE)\\bin\\nt
source csejtag.tcl
namespace import ::chipscope::*
# Platform USB Cable
set PLATFORM_USB_CABLE_ARGS [list "port=USB2" "frequency=6000000"]
# frequency="24000000 | 12000000 | 6000000 | 3000000 | 1500000 | 750000"
# Create session
set handle [::chipscope::csejtag_session create 0]
# Open JTAG and lock
set open_result [::chipscope::csejtag_target open $handle $CSEJTAG_TARGET_PLATFORMUSB 0 $PLATFORM_USB_CABLE_ARGS]
set lock_result [::chipscope::csejtag_target lock $handle 1000]
set devlist [::chipscope::csejtag_tap autodetect_chain $handle $CSEJTAG_SCAN_DEFAULT]
# Get Device ID
set devtype "Virtex-4SX"
set devid 2
set irlength [::chipscope::csejtag_tap get_irlength $handle $devid]
set idcode [::chipscope::csejtag_tap get_device_idcode $handle $devid]
set CSE_OP $CSEJTAG_SHIFT_READWRITE
set CSE_ES $CSEJTAG_RUN_TEST_IDLE
# Write Program
# JASM_ROM_INSERT_HERE
# Assembled from reti_issue.jsm
# ---------------------------------------------------------------
# Shift the USER2 Instruction (b1111000010) into the Instruction Register of FPGA
# User 1
set result [::chipscope::csejtag_tap shift_device_ir $handle $devid $CSE_OP $CSE_ES 0 $irlength "3C2"]
# 0x000: JMP 0x002
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "00030002"
# 0x001: RETI
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "0013F000"
# 0x002: MOV R00, 0x05
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "00203050"
# 0x003: COUT (0x03), R00
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "00326030"
# 0x004: MOV R00, 0x00
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "00403000"
# 0x005: NOP
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "00500000"
# 0x006: INC R00
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "00611010"
# 0x007: NOP
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "00700000"
# 0x008: CALL 0x01B
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "0083B01B"
# 0x009: NOP
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "00900000"
# 0x00A: PUSH R03
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "00A3C003"
# 0x00B: NOP
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "00B00000"
# 0x00C: PUSH R02
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "00C3C002"
# 0x00D: NOP
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "00D00000"
# 0x00E: PUSH R01
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "00E3C001"
# 0x00F: NOP
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "00F00000"
# 0x010: PUSH R00
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "0103C000"
# 0x011: NOP
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "01100000"
# 0x012: POP R00
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "0123D000"
# 0x013: NOP
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "01300000"
# 0x014: POP R01
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "0143D001"
# 0x015: NOP
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "01500000"
# 0x016: POP R02
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "0163D002"
# 0x017: NOP
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "01700000"
# 0x018: POP R03
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "0183D003"
# 0x019: NOP
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "01900000"
# 0x01A: JMP 0x005
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "01A30005"
# 0x01B: RET
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "01B3E000"
# Assembled from reti_issue.jsm
# ---------------------------------------------------------------
# Shift the USER2 Instruction (b1111000011) into the Instruction Register of FPGA
# User 2
set result [::chipscope::csejtag_tap shift_device_ir $handle $devid $CSE_OP $CSE_ES 0 $irlength "3C3"]
::chipscope::csejtag_target unlock $handle
::chipscope::csejtag_target close $handle
::chipscope::csejtag_session destroy $handle
exit
Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.5 KiB

-22
View File
@@ -1,22 +0,0 @@
## NOTE: Do not edit this file.
##
vlib work
vcom -explicit -93 "../../../PCK_FIO-1.16/PCK_FIO.vhd"
vcom -explicit -93 "../src/core/cpu_pkg.vhd"
vcom -explicit -93 "../src/core/stack_ctrl.vhd"
vcom -explicit -93 "../src/core/reg_dual.vhd"
vcom -explicit -93 "../src/core/chipram.vhd"
vcom -explicit -93 "../src/core/chipreg.vhd"
vcom -explicit -93 "../src/core/pc.vhd"
vcom -explicit -93 "../src/core/dpath_ctrl.vhd"
vcom -explicit -93 "../src/core/int_ctrl.vhd"
vcom -explicit -93 "../src/core/alu.vhd"
vcom -explicit -93 "../src/core/cpu.vhd"
vcom -explicit -93 "../src/test_irom.vhdl"
vcom -explicit -93 "../src/core/tb_cpu.vhd"
vsim -t 1ps -lib work tb_cpu
do {tb_cpu.wdo}
view wave
view structure
view signals
run 50us
-107
View File
@@ -1,107 +0,0 @@
onerror {resume}
quietly WaveActivateNextPane {} 0
add wave -noupdate -format Logic /tb_cpu/rst
add wave -noupdate -format Logic /tb_cpu/clk
add wave -noupdate -format Logic /tb_cpu/ce
add wave -noupdate -format Logic /tb_cpu/uut/cpu_active
add wave -noupdate -format Logic /tb_cpu/int_in
add wave -noupdate -format Logic /tb_cpu/int_ack
add wave -noupdate -format Literal -radix hexadecimal /tb_cpu/irom_data
add wave -noupdate -format Literal -radix hexadecimal /tb_cpu/irom_addr
add wave -noupdate -format Literal -radix hexadecimal /tb_cpu/xmem_din
add wave -noupdate -format Literal -radix hexadecimal /tb_cpu/xmem_dout
add wave -noupdate -format Literal -radix hexadecimal /tb_cpu/xmem_addr
add wave -noupdate -format Logic /tb_cpu/xmem_we
add wave -noupdate -format Logic /tb_cpu/xmem_re
add wave -noupdate -format Literal -radix hexadecimal /tb_cpu/sram
add wave -noupdate -format Logic /tb_cpu/uut/io_sel
add wave -noupdate -format Literal /tb_cpu/uut/iphase
add wave -noupdate -divider CPU
add wave -noupdate -format Literal /tb_cpu/reg
add wave -noupdate -format Literal /tb_cpu/uut/inst_dpath_ctrl/dbg_iname
add wave -noupdate -format Literal /tb_cpu/uut/cpu_status
add wave -noupdate -format Literal /tb_cpu/uut/status_reg
add wave -noupdate -format Literal /tb_cpu/uut/ctrl
add wave -noupdate -format Literal -radix hexadecimal /tb_cpu/uut/stk_out
add wave -noupdate -format Literal -radix hexadecimal /tb_cpu/uut/stk_in
add wave -noupdate -format Literal -radix hexadecimal /tb_cpu/uut/stk_reg
add wave -noupdate -format Literal -radix hexadecimal /tb_cpu/uut/pc_in
add wave -noupdate -format Literal -radix hexadecimal /tb_cpu/uut/pc_next
add wave -noupdate -format Literal -radix hexadecimal /tb_cpu/uut/idata
add wave -noupdate -format Literal -radix hexadecimal /tb_cpu/uut/int_pc_addr
add wave -noupdate -format Literal -radix hexadecimal /tb_cpu/uut/iphase
add wave -noupdate -format Literal -radix hexadecimal /tb_cpu/uut/const_data
add wave -noupdate -format Literal -radix hexadecimal /tb_cpu/uut/reg_a_dout
add wave -noupdate -format Literal -radix hexadecimal /tb_cpu/uut/reg_b_dout
add wave -noupdate -format Literal -radix hexadecimal /tb_cpu/uut/reg_din
add wave -noupdate -format Literal -radix hexadecimal /tb_cpu/uut/alu_op1
add wave -noupdate -format Literal -radix hexadecimal /tb_cpu/uut/alu_op2
add wave -noupdate -format Literal -radix hexadecimal /tb_cpu/uut/alu_result
add wave -noupdate -format Literal /tb_cpu/uut/alu_status
add wave -noupdate -format Logic /tb_cpu/uut/pc_inc
add wave -noupdate -format Logic /tb_cpu/uut/pc_load
add wave -noupdate -format Logic /tb_cpu/uut/stk_we
add wave -noupdate -format Logic /tb_cpu/uut/cmem_we
add wave -noupdate -format Literal /tb_cpu/uut/ctrl_iphase
add wave -noupdate -format Logic /tb_cpu/uut/was_pcld
add wave -noupdate -format Logic /tb_cpu/uut/was_pop2pc
add wave -noupdate -format Logic /tb_cpu/uut/int_pc_load
add wave -noupdate -format Logic /tb_cpu/uut/int_stk_push
add wave -noupdate -format Logic /tb_cpu/uut/stk_push
add wave -noupdate -format Logic /tb_cpu/uut/stk_pop
add wave -noupdate -format Logic /tb_cpu/uut/status_save
add wave -noupdate -format Logic /tb_cpu/uut/status_restore
add wave -noupdate -format Literal -radix hexadecimal /tb_cpu/uut/stk_ptr
add wave -noupdate -divider Stack
add wave -noupdate -format Logic /tb_cpu/clk
add wave -noupdate -format Literal /tb_cpu/uut/inst_dpath_ctrl/dbg_iname
add wave -noupdate -format Logic /tb_cpu/uut/inst_stack_ctrl/push
add wave -noupdate -format Logic /tb_cpu/uut/inst_stack_ctrl/pop
add wave -noupdate -format Literal -radix hexadecimal /tb_cpu/uut/inst_stack_ctrl/din
add wave -noupdate -format Literal -radix hexadecimal /tb_cpu/uut/inst_stack_ctrl/dout
add wave -noupdate -format Logic /tb_cpu/uut/inst_stack_ctrl/mem_we
add wave -noupdate -divider Chipram
add wave -noupdate -format Logic /tb_cpu/uut/inst_chipram/we_a
add wave -noupdate -format Literal -radix hexadecimal /tb_cpu/uut/inst_chipram/din_a
add wave -noupdate -format Literal -radix hexadecimal /tb_cpu/uut/inst_chipram/addr_a
add wave -noupdate -format Literal -radix hexadecimal /tb_cpu/uut/inst_chipram/dout_a
add wave -noupdate -format Logic /tb_cpu/uut/inst_chipram/we_b
add wave -noupdate -format Literal -radix hexadecimal /tb_cpu/uut/inst_chipram/din_b
add wave -noupdate -format Literal -radix hexadecimal /tb_cpu/uut/inst_chipram/addr_b
add wave -noupdate -format Literal -radix hexadecimal /tb_cpu/uut/inst_chipram/dout_b
add wave -noupdate -divider Sequencer
add wave -noupdate -format Literal -radix hexadecimal /tb_cpu/uut/inst_dpath_ctrl/inst_in
add wave -noupdate -format Literal /tb_cpu/uut/inst_dpath_ctrl/iphase_in
add wave -noupdate -format Literal /tb_cpu/uut/inst_dpath_ctrl/status_in
add wave -noupdate -format Literal /tb_cpu/uut/inst_dpath_ctrl/ctrl_out
add wave -noupdate -format Literal -radix hexadecimal /tb_cpu/uut/inst_dpath_ctrl/idout
add wave -noupdate -format Literal -radix hexadecimal /tb_cpu/uut/inst_dpath_ctrl/ddout
add wave -noupdate -format Literal /tb_cpu/uut/inst_dpath_ctrl/opcode
add wave -noupdate -format Literal /tb_cpu/uut/inst_dpath_ctrl/ctrl_lines
add wave -noupdate -format Literal /tb_cpu/uut/inst_dpath_ctrl/dbg_iname
add wave -noupdate -format Literal -radix hexadecimal -expand /tb_cpu/uut/inst_reg_ab/mem
add wave -noupdate -divider {Chip register}
add wave -noupdate -format Literal -radix hexadecimal /tb_cpu/uut/creg_addr
add wave -noupdate -format Literal -radix hexadecimal /tb_cpu/uut/creg_din
add wave -noupdate -format Literal -radix hexadecimal /tb_cpu/uut/creg_dout
add wave -noupdate -format Literal /tb_cpu/uut/creg_ctrl_out
add wave -noupdate -format Literal /tb_cpu/uut/inst_dpath_ctrl/dbg_iname
add wave -noupdate -format Logic /tb_cpu/clk
add wave -noupdate -format Logic /tb_cpu/uut/inst_int_ctrl/int_exit
add wave -noupdate -format Literal /tb_cpu/uut/inst_int_ctrl/int_state
TreeUpdate [SetDefaultTree]
WaveRestoreCursors {{Cursor 1} {136355 ps} 0}
configure wave -namecolwidth 166
configure wave -valuecolwidth 101
configure wave -justifyvalue left
configure wave -signalnamewidth 1
configure wave -snapdistance 10
configure wave -datasetprefix 0
configure wave -rowmargin 4
configure wave -childrowmargin 2
configure wave -gridoffset 0
configure wave -gridperiod 1
configure wave -griddelta 40
configure wave -timeline 0
update
WaveRestoreZoom {93532 ps} {206468 ps}
-21
View File
@@ -1,21 +0,0 @@
## NOTE: Do not edit this file.
##
vlib work
vcom -explicit -93 "../src/core/cpu_pkg.vhd"
vcom -explicit -93 "../src/core/stack_ctrl.vhd"
vcom -explicit -93 "../src/core/reg_dual.vhd"
vcom -explicit -93 "../src/core/chipram.vhd"
vcom -explicit -93 "../src/core/pc.vhd"
vcom -explicit -93 "../src/core/dpath_ctrl.vhd"
vcom -explicit -93 "../src/core/int_ctrl.vhd"
vcom -explicit -93 "../src/core/alu.vhd"
vcom -explicit -93 "../src/core/cpu.vhd"
vcom -explicit -93 "../src/cpu_embedded.vhd"
vcom -explicit -93 "../src/tb_cpu_embedded.vhd"
vcom -explicit -93 "../src/test_irom.vhdl"
vsim -t 1ps -lib work tb_cpu_embedded
do {tb_cpu_embedded.wdo}
view wave
view structure
view signals
run 10us
-26
View File
@@ -1,26 +0,0 @@
onerror {resume}
quietly WaveActivateNextPane {} 0
add wave -noupdate -format Logic /tb_cpu_embedded/rst
add wave -noupdate -format Logic /tb_cpu_embedded/clk
add wave -noupdate -format Logic /tb_cpu_embedded/ce
add wave -noupdate -format Literal -radix hexadecimal /tb_cpu_embedded/sram
add wave -noupdate -format Logic /tb_cpu_embedded/int_in
add wave -noupdate -format Logic /tb_cpu_embedded/int_ack
add wave -noupdate -format Literal -radix hexadecimal /tb_cpu_embedded/uut/rom_addr
add wave -noupdate -format Literal -radix hexadecimal /tb_cpu_embedded/uut/rom_data
TreeUpdate [SetDefaultTree]
WaveRestoreCursors {{Cursor 1} {2168142 ps} 0}
configure wave -namecolwidth 143
configure wave -valuecolwidth 101
configure wave -justifyvalue left
configure wave -signalnamewidth 1
configure wave -snapdistance 10
configure wave -datasetprefix 0
configure wave -rowmargin 4
configure wave -childrowmargin 2
configure wave -gridoffset 0
configure wave -gridperiod 1
configure wave -griddelta 40
configure wave -timeline 0
update
WaveRestoreZoom {0 ps} {10500 ns}
-22
View File
@@ -1,22 +0,0 @@
## NOTE: Do not edit this file.
##
vlib work
vcom -explicit -93 "../../../PCK_FIO-1.16/PCK_FIO.vhd"
vcom -explicit -93 "../src/core/cpu_pkg.vhd"
vcom -explicit -93 "../src/core/stack_ctrl.vhd"
vcom -explicit -93 "../src/core/reg_dual.vhd"
vcom -explicit -93 "../src/core/chipram.vhd"
vcom -explicit -93 "../src/core/chipreg.vhd"
vcom -explicit -93 "../src/core/pc.vhd"
vcom -explicit -93 "../src/core/dpath_ctrl.vhd"
vcom -explicit -93 "../src/core/int_ctrl.vhd"
vcom -explicit -93 "../src/core/alu.vhd"
vcom -explicit -93 "../src/core/cpu.vhd"
vcom -explicit -93 "../src/itest_irom.vhdl"
vcom -explicit -93 "../src/tb_cpu_itest.vhd"
vsim -t 1ps -lib work tb_cpu
do {tb_cpu_itest.wdo}
view wave
view structure
view signals
run 400us
-123
View File
@@ -1,123 +0,0 @@
onerror {resume}
quietly WaveActivateNextPane {} 0
add wave -noupdate -format Logic /tb_cpu/rst
add wave -noupdate -format Logic /tb_cpu/clk
add wave -noupdate -format Logic /tb_cpu/ce
add wave -noupdate -format Logic /tb_cpu/int_in
add wave -noupdate -format Logic /tb_cpu/int_ack
add wave -noupdate -format Literal -radix hexadecimal /tb_cpu/irom_data
add wave -noupdate -format Literal -radix hexadecimal /tb_cpu/irom_addr
add wave -noupdate -format Literal -radix hexadecimal /tb_cpu/xmem_din
add wave -noupdate -format Literal -radix hexadecimal /tb_cpu/xmem_dout
add wave -noupdate -format Literal -radix hexadecimal /tb_cpu/xmem_addr
add wave -noupdate -format Logic /tb_cpu/xmem_we
add wave -noupdate -format Logic /tb_cpu/xmem_re
add wave -noupdate -format Logic /tb_cpu/xmem_wait
add wave -noupdate -format Literal -radix hexadecimal /tb_cpu/sram
add wave -noupdate -format Literal -radix hexadecimal -expand /tb_cpu/reg
add wave -noupdate -format Logic /tb_cpu/uut/io_sel
add wave -noupdate -format Literal -radix hexadecimal /tb_cpu/uut/mem_data
add wave -noupdate -format Literal -radix hexadecimal /tb_cpu/uut/mem_addr
add wave -noupdate -divider CPU
add wave -noupdate -format Literal /tb_cpu/uut/inst_dpath_ctrl/dbg_iname
add wave -noupdate -format Literal /tb_cpu/uut/cpu_status
add wave -noupdate -format Literal /tb_cpu/uut/status_reg
add wave -noupdate -format Literal /tb_cpu/uut/ctrl
add wave -noupdate -format Literal -radix hexadecimal /tb_cpu/uut/stk_out
add wave -noupdate -format Literal -radix hexadecimal /tb_cpu/uut/stk_in
add wave -noupdate -format Literal -radix hexadecimal /tb_cpu/uut/stk_reg
add wave -noupdate -format Literal -radix hexadecimal /tb_cpu/uut/pc_in
add wave -noupdate -format Literal -radix hexadecimal /tb_cpu/uut/pc_next
add wave -noupdate -format Literal -radix hexadecimal /tb_cpu/uut/idata
add wave -noupdate -format Literal -radix hexadecimal /tb_cpu/uut/int_pc_addr
add wave -noupdate -format Literal -radix hexadecimal /tb_cpu/uut/iphase
add wave -noupdate -format Literal -radix hexadecimal /tb_cpu/uut/const_data
add wave -noupdate -format Literal -radix hexadecimal /tb_cpu/uut/reg_a_dout
add wave -noupdate -format Literal -radix hexadecimal /tb_cpu/uut/reg_b_dout
add wave -noupdate -format Literal -radix hexadecimal /tb_cpu/uut/reg_din
add wave -noupdate -format Literal -radix hexadecimal /tb_cpu/uut/alu_op1
add wave -noupdate -format Literal -radix hexadecimal /tb_cpu/uut/alu_op2
add wave -noupdate -format Literal -radix hexadecimal /tb_cpu/uut/alu_result
add wave -noupdate -format Literal /tb_cpu/uut/alu_status
add wave -noupdate -format Logic /tb_cpu/uut/pc_inc
add wave -noupdate -format Logic /tb_cpu/uut/pc_load
add wave -noupdate -format Logic /tb_cpu/uut/cpu_active
add wave -noupdate -format Logic /tb_cpu/uut/stk_we
add wave -noupdate -format Logic /tb_cpu/uut/cmem_we
add wave -noupdate -format Literal /tb_cpu/uut/ctrl_iphase
add wave -noupdate -format Logic /tb_cpu/uut/was_pcld
add wave -noupdate -format Logic /tb_cpu/uut/was_pop2pc
add wave -noupdate -format Logic /tb_cpu/uut/int_pc_load
add wave -noupdate -format Logic /tb_cpu/uut/int_stk_push
add wave -noupdate -format Logic /tb_cpu/uut/stk_push
add wave -noupdate -format Logic /tb_cpu/uut/stk_pop
add wave -noupdate -format Logic /tb_cpu/uut/status_save
add wave -noupdate -format Logic /tb_cpu/uut/status_restore
add wave -noupdate -format Literal -radix hexadecimal /tb_cpu/uut/stk_ptr
add wave -noupdate -divider Stack
add wave -noupdate -format Logic /tb_cpu/clk
add wave -noupdate -format Literal /tb_cpu/uut/inst_dpath_ctrl/dbg_iname
add wave -noupdate -format Logic /tb_cpu/uut/inst_stack_ctrl/push
add wave -noupdate -format Logic /tb_cpu/uut/inst_stack_ctrl/pop
add wave -noupdate -format Literal -radix hexadecimal /tb_cpu/uut/inst_stack_ctrl/din
add wave -noupdate -format Literal -radix hexadecimal /tb_cpu/uut/inst_stack_ctrl/dout
add wave -noupdate -format Logic /tb_cpu/uut/inst_stack_ctrl/mem_we
add wave -noupdate -divider Chipram
add wave -noupdate -format Logic /tb_cpu/uut/inst_chipram/we_a
add wave -noupdate -format Literal -radix hexadecimal /tb_cpu/uut/inst_chipram/din_a
add wave -noupdate -format Literal -radix hexadecimal /tb_cpu/uut/inst_chipram/addr_a
add wave -noupdate -format Literal -radix hexadecimal /tb_cpu/uut/inst_chipram/dout_a
add wave -noupdate -format Logic /tb_cpu/uut/inst_chipram/we_b
add wave -noupdate -format Literal -radix hexadecimal /tb_cpu/uut/inst_chipram/din_b
add wave -noupdate -format Literal -radix hexadecimal /tb_cpu/uut/inst_chipram/addr_b
add wave -noupdate -format Literal -radix hexadecimal /tb_cpu/uut/inst_chipram/dout_b
add wave -noupdate -divider Sequencer
add wave -noupdate -format Literal -radix hexadecimal /tb_cpu/reg
add wave -noupdate -format Literal -radix hexadecimal /tb_cpu/uut/inst_dpath_ctrl/inst_in
add wave -noupdate -format Literal /tb_cpu/uut/inst_dpath_ctrl/iphase_in
add wave -noupdate -format Literal /tb_cpu/uut/inst_dpath_ctrl/status_in
add wave -noupdate -format Literal /tb_cpu/uut/inst_dpath_ctrl/ctrl_out
add wave -noupdate -format Literal -radix hexadecimal /tb_cpu/uut/inst_dpath_ctrl/idout
add wave -noupdate -format Literal -radix hexadecimal /tb_cpu/uut/inst_dpath_ctrl/ddout
add wave -noupdate -format Literal /tb_cpu/uut/inst_dpath_ctrl/opcode
add wave -noupdate -format Literal /tb_cpu/uut/inst_dpath_ctrl/ctrl_lines
add wave -noupdate -format Literal /tb_cpu/uut/inst_dpath_ctrl/dbg_iname
add wave -noupdate -format Literal -radix hexadecimal -expand /tb_cpu/uut/inst_reg_ab/mem
add wave -noupdate -divider {Chip register}
add wave -noupdate -format Literal -radix hexadecimal /tb_cpu/uut/creg_dout
add wave -noupdate -format Literal /tb_cpu/uut/creg_ctrl_out
add wave -noupdate -format Literal /tb_cpu/uut/inst_dpath_ctrl/dbg_iname
add wave -noupdate -format Logic /tb_cpu/clk
add wave -noupdate -divider {Interrup Ctrl.}
add wave -noupdate -format Logic /tb_cpu/uut/inst_int_ctrl/int_in
add wave -noupdate -format Literal -expand /tb_cpu/uut/inst_int_ctrl/ctrl_in
add wave -noupdate -format Logic /tb_cpu/uut/inst_int_ctrl/int_sampled
add wave -noupdate -format Logic /tb_cpu/uut/inst_int_ctrl/int_request
add wave -noupdate -format Logic /tb_cpu/uut/inst_int_ctrl/int_ack
add wave -noupdate -format Logic /tb_cpu/uut/inst_int_ctrl/int_exit
add wave -noupdate -format Logic /tb_cpu/uut/inst_int_ctrl/int_ack_out
add wave -noupdate -format Logic /tb_cpu/uut/inst_int_ctrl/stat_save_out
add wave -noupdate -format Logic /tb_cpu/uut/inst_int_ctrl/stat_rest_out
add wave -noupdate -format Logic /tb_cpu/uut/inst_int_ctrl/pc_load_out
add wave -noupdate -format Logic /tb_cpu/uut/inst_int_ctrl/stk_push_out
add wave -noupdate -format Logic /tb_cpu/uut/inst_int_ctrl/stk_pop_out
add wave -noupdate -format Literal /tb_cpu/uut/inst_int_ctrl/int_state
add wave -noupdate -format Logic /tb_cpu/uut/inst_int_ctrl/pc_load
add wave -noupdate -format Logic /tb_cpu/uut/inst_int_ctrl/stk_push
add wave -noupdate -format Logic /tb_cpu/uut/inst_int_ctrl/stk_pop
TreeUpdate [SetDefaultTree]
WaveRestoreCursors {{Cursor 1} {53866171 ps} 0}
configure wave -namecolwidth 166
configure wave -valuecolwidth 101
configure wave -justifyvalue left
configure wave -signalnamewidth 1
configure wave -snapdistance 10
configure wave -datasetprefix 0
configure wave -rowmargin 4
configure wave -childrowmargin 2
configure wave -gridoffset 0
configure wave -gridperiod 1
configure wave -griddelta 40
configure wave -timeline 0
update
WaveRestoreZoom {0 ps} {420 us}
-22
View File
@@ -1,22 +0,0 @@
## NOTE: Do not edit this file.
##
vlib work
vcom -explicit -93 "../../../PCK_FIO-1.16/PCK_FIO.vhd"
vcom -explicit -93 "../src/core/cpu_pkg.vhd"
vcom -explicit -93 "../src/core/stack_ctrl.vhd"
vcom -explicit -93 "../src/core/reg_dual.vhd"
vcom -explicit -93 "../src/core/chipram.vhd"
vcom -explicit -93 "../src/core/chipreg.vhd"
vcom -explicit -93 "../src/core/pc.vhd"
vcom -explicit -93 "../src/core/dpath_ctrl.vhd"
vcom -explicit -93 "../src/core/int_ctrl.vhd"
vcom -explicit -93 "../src/core/alu.vhd"
vcom -explicit -93 "../src/core/cpu.vhd"
vcom -explicit -93 "../src/irom_reti_issue.vhdl"
vcom -explicit -93 "../src/core/tb_cpu.vhd"
vsim -t 1ps -lib work tb_cpu
do {tb_cpu_reti_issue.wdo}
view wave
view structure
view signals
run 50us
-82
View File
@@ -1,82 +0,0 @@
onerror {resume}
quietly WaveActivateNextPane {} 0
add wave -noupdate -format Literal /tb_cpu/uut/iphase
add wave -noupdate -format Literal /tb_cpu/uut/inst_dpath_ctrl/ctrl_lines
add wave -noupdate -divider {Chip RAM}
add wave -noupdate -format Literal /tb_cpu/uut/iphase
add wave -noupdate -format Literal /tb_cpu/uut/inst_dpath_ctrl/dbg_iname
add wave -noupdate -format Logic /tb_cpu/uut/inst_chipram/clka
add wave -noupdate -format Logic /tb_cpu/uut/inst_chipram/clkb
add wave -noupdate -format Logic /tb_cpu/uut/inst_chipram/en_a
add wave -noupdate -format Logic /tb_cpu/uut/inst_chipram/en_b
add wave -noupdate -format Logic /tb_cpu/uut/inst_chipram/we_a
add wave -noupdate -format Logic /tb_cpu/uut/inst_chipram/we_b
add wave -noupdate -format Literal -radix hexadecimal /tb_cpu/uut/inst_chipram/addr_a
add wave -noupdate -format Literal -radix hexadecimal /tb_cpu/uut/inst_chipram/addr_b
add wave -noupdate -format Literal -radix hexadecimal /tb_cpu/uut/inst_chipram/din_a
add wave -noupdate -format Literal -radix hexadecimal /tb_cpu/uut/inst_chipram/din_b
add wave -noupdate -format Literal -radix hexadecimal /tb_cpu/uut/inst_chipram/dout_a
add wave -noupdate -format Literal -radix hexadecimal /tb_cpu/uut/inst_chipram/dout_b
add wave -noupdate -divider {Interrupt controller}
add wave -noupdate -format Literal /tb_cpu/uut/iphase
add wave -noupdate -format Literal /tb_cpu/uut/inst_dpath_ctrl/dbg_iname
add wave -noupdate -format Logic /tb_cpu/uut/inst_int_ctrl/rst
add wave -noupdate -format Logic /tb_cpu/uut/inst_int_ctrl/clk
add wave -noupdate -format Literal /tb_cpu/uut/inst_int_ctrl/ctrl_in
add wave -noupdate -format Logic /tb_cpu/uut/inst_int_ctrl/int_in
add wave -noupdate -format Logic /tb_cpu/uut/inst_int_ctrl/int_reg
add wave -noupdate -format Logic /tb_cpu/uut/inst_int_ctrl/int_request
add wave -noupdate -format Logic /tb_cpu/uut/inst_int_ctrl/int_request_clr
add wave -noupdate -format Logic /tb_cpu/uut/inst_int_ctrl/int_exit
add wave -noupdate -format Literal /tb_cpu/uut/inst_int_ctrl/iphase_in
add wave -noupdate -format Literal -radix hexadecimal /tb_cpu/uut/inst_int_ctrl/pc_addr_out
add wave -noupdate -format Logic /tb_cpu/uut/inst_int_ctrl/int_ack
add wave -noupdate -format Logic /tb_cpu/uut/inst_int_ctrl/stat_save_out
add wave -noupdate -format Logic /tb_cpu/uut/inst_int_ctrl/stat_rest_out
add wave -noupdate -format Logic /tb_cpu/uut/inst_int_ctrl/pc_load_out
add wave -noupdate -format Logic /tb_cpu/uut/inst_int_ctrl/stk_push_out
add wave -noupdate -format Literal /tb_cpu/uut/inst_int_ctrl/int_state
add wave -noupdate -format Literal /tb_cpu/uut/inst_int_ctrl/int_state_next
add wave -noupdate -format Logic /tb_cpu/uut/inst_int_ctrl/pc_load
add wave -noupdate -format Logic /tb_cpu/uut/inst_int_ctrl/stk_push
add wave -noupdate -format Logic /tb_cpu/uut/inst_int_ctrl/stk_pop
add wave -noupdate -format Logic /tb_cpu/uut/inst_int_ctrl/stk_pop_out
add wave -noupdate -format Logic /tb_cpu/uut/inst_int_ctrl/stk_push_out
add wave -noupdate -divider PC
add wave -noupdate -format Literal /tb_cpu/uut/iphase
add wave -noupdate -format Literal /tb_cpu/uut/inst_dpath_ctrl/dbg_iname
add wave -noupdate -format Logic /tb_cpu/uut/inst_pc/rst
add wave -noupdate -format Logic /tb_cpu/uut/inst_pc/clk
add wave -noupdate -format Logic /tb_cpu/uut/inst_pc/inc
add wave -noupdate -format Logic /tb_cpu/uut/inst_pc/load
add wave -noupdate -format Literal -radix hexadecimal /tb_cpu/uut/inst_pc/pc_in
add wave -noupdate -format Literal -radix hexadecimal /tb_cpu/uut/inst_pc/pc_out
add wave -noupdate -format Literal -radix hexadecimal /tb_cpu/uut/inst_pc/pc_next
add wave -noupdate -divider {Stack controller}
add wave -noupdate -format Literal /tb_cpu/uut/iphase
add wave -noupdate -format Literal /tb_cpu/uut/inst_dpath_ctrl/dbg_iname
add wave -noupdate -format Logic /tb_cpu/uut/inst_stack_ctrl/rst
add wave -noupdate -format Logic /tb_cpu/uut/inst_stack_ctrl/clk
add wave -noupdate -format Logic /tb_cpu/uut/inst_stack_ctrl/push
add wave -noupdate -format Logic /tb_cpu/uut/inst_stack_ctrl/pop
add wave -noupdate -format Literal -radix hexadecimal /tb_cpu/uut/inst_stack_ctrl/ptr_out
add wave -noupdate -format Literal -radix hexadecimal /tb_cpu/uut/inst_stack_ctrl/din
add wave -noupdate -format Literal -radix hexadecimal /tb_cpu/uut/inst_stack_ctrl/dout
add wave -noupdate -format Logic /tb_cpu/uut/inst_stack_ctrl/mem_we
add wave -noupdate -format Literal -radix hexadecimal /tb_cpu/uut/inst_stack_ctrl/ptr
TreeUpdate [SetDefaultTree]
WaveRestoreCursors {{Cursor 1} {8115990 ps} 0}
configure wave -namecolwidth 150
configure wave -valuecolwidth 100
configure wave -justifyvalue left
configure wave -signalnamewidth 1
configure wave -snapdistance 10
configure wave -datasetprefix 0
configure wave -rowmargin 4
configure wave -childrowmargin 2
configure wave -gridoffset 0
configure wave -gridperiod 1
configure wave -griddelta 40
configure wave -timeline 0
update
WaveRestoreZoom {8048536 ps} {8340629 ps}
-21
View File
@@ -1,21 +0,0 @@
## NOTE: Do not edit this file.
##
vlib work
vcom -explicit -93 "../src/core/cpu_pkg.vhd"
vcom -explicit -93 "../src/core/stack_ctrl.vhd"
vcom -explicit -93 "../src/core/reg_dual.vhd"
vcom -explicit -93 "../src/core/chipram.vhd"
vcom -explicit -93 "../src/core/pc.vhd"
vcom -explicit -93 "../src/core/dpath_ctrl.vhd"
vcom -explicit -93 "../src/core/int_ctrl.vhd"
vcom -explicit -93 "../src/core/alu.vhd"
vcom -explicit -93 "../src/core/cpu.vhd"
vcom -explicit -93 "../src/cpu_embedded.vhd"
vcom -explicit -93 "../src/tb_cpu_embedded.vhd"
vcom -explicit -93 "../src/mul8x8_irom.vhdl"
vsim -t 1ps -lib work tb_cpu_embedded
do {tb_mul8x8.wdo}
view wave
view structure
view signals
run 10us
-31
View File
@@ -1,31 +0,0 @@
onerror {resume}
quietly WaveActivateNextPane {} 0
add wave -noupdate -format Logic /tb_cpu_embedded/uut/inst_cpu/rst
add wave -noupdate -format Logic /tb_cpu_embedded/uut/inst_cpu/clk
add wave -noupdate -format Logic /tb_cpu_embedded/uut/inst_cpu/ce
add wave -noupdate -format Literal -radix hexadecimal /tb_cpu_embedded/uut/inst_cpu/instr_din
add wave -noupdate -format Literal -radix hexadecimal /tb_cpu_embedded/uut/inst_cpu/instr_addr
add wave -noupdate -format Literal /tb_cpu_embedded/uut/inst_cpu/cpu_status
add wave -noupdate -format Literal /tb_cpu_embedded/uut/inst_cpu/status_reg
add wave -noupdate -format Literal -radix hexadecimal /tb_cpu_embedded/uut/inst_cpu/alu_op1
add wave -noupdate -format Literal -radix hexadecimal /tb_cpu_embedded/uut/inst_cpu/alu_op2
add wave -noupdate -format Literal -radix hexadecimal /tb_cpu_embedded/uut/inst_cpu/alu_result
add wave -noupdate -format Literal /tb_cpu_embedded/uut/inst_cpu/alu_status
add wave -noupdate -format Literal /tb_cpu_embedded/uut/inst_cpu/inst_dpath_ctrl/dbg_iname
add wave -noupdate -format Literal -radix hexadecimal -expand /tb_cpu_embedded/uut/inst_cpu/inst_reg_ab/mem
TreeUpdate [SetDefaultTree]
WaveRestoreCursors {{Cursor 1} {529679 ps} 0}
configure wave -namecolwidth 143
configure wave -valuecolwidth 101
configure wave -justifyvalue left
configure wave -signalnamewidth 1
configure wave -snapdistance 10
configure wave -datasetprefix 0
configure wave -rowmargin 4
configure wave -childrowmargin 2
configure wave -gridoffset 0
configure wave -gridperiod 1
configure wave -griddelta 40
configure wave -timeline 0
update
WaveRestoreZoom {9002500 ps} {10052500 ps}
-236
View File
@@ -1,236 +0,0 @@
--------------------------------------------------------------------------
-- Project: JCPU, a portable 8-bit RISC CPU written in VHDL
-- This file: The arithmetic logic unit
--
-- Copyright (C) 2007 J. Ahrensfeld
--
-- This program is free software: you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
-- the Free Software Foundation, either version 3 of the License, or
-- (at your option) any later version.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU General Public License for more details.
--
-- You should have received a copy of the GNU General Public License
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
--
-- For questions and ideas, please contact the author at jens@jayfield.org
--
--------------------------------------------------------------------------
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.numeric_std.ALL;
use work.cpu_pkg.all;
entity alu is
Generic (
data_width : integer := 8
);
Port (
rst : in STD_LOGIC;
clk : in STD_LOGIC;
op_en : in STD_LOGIC;
cy_in : in STD_LOGIC;
op1_in : in unsigned (data_width-1 downto 0);
op2_in : in unsigned (data_width-1 downto 0);
opsel : in alu_op_t;
res_out : out unsigned (data_width-1 downto 0);
stat_load : in STD_LOGIC;
stat_in : in alu_status_t;
stat_out : out alu_status_t
);
end alu;
architecture Behavioral of alu is
signal sum_cy, sh_cy, sum_cy_in, sh_cy_in, left_shift, add_subn : STD_LOGIC;
signal result, sum_res, lf_res, sh_res, res_reg : unsigned (data_width-1 downto 0);
signal status, stat_reg : alu_status_t;
--------------------------------------------------------------------------
function test_zero(arg : unsigned) return STD_LOGIC is
variable result : STD_LOGIC;
begin
result := '0';
for i in arg'range loop
result := result or To_X01(arg(i));
end loop;
return not result;
end test_zero;
--------------------------------------------------------------------------
begin
--------------------------------------------------------------------------
proc_logic_func:
process (op1_in, op2_in, opsel)
begin
case opsel is
when op1_and_op2 =>
lf_res <= op1_in and op2_in;
when op1_or_op2 =>
lf_res <= op1_in or op2_in;
when op1_xor_op2 =>
lf_res <= op1_in xor op2_in;
when others =>
lf_res <= (others => '-');
end case;
end process;
--------------------------------------------------------------------------
proc_shift_func:
process (op1_in, left_shift, sh_cy_in)
begin
if left_shift = '1' then
sh_res <= op1_in(op1_in'left-1 downto op1_in'right) & sh_cy_in;
sh_cy <= op1_in(op1_in'left);
else
sh_res <= sh_cy_in & op1_in(op1_in'left downto op1_in'right+1);
sh_cy <= op1_in(op1_in'right);
end if;
end process;
--------------------------------------------------------------------------
proc_alu_out:
process(opsel, op1_in, op2_in, res_reg, stat_reg, lf_res, sum_res, sh_res, sum_cy, sh_cy, cy_in)
begin
case opsel is
when op1_add_op2 | op1_sub_op2 | op1_addc_op2 | op1_subc_op2 =>
status.zero <= test_zero(res_reg);
status.carry <= sum_cy;
result <= sum_res;
when op1_and_op2 | op1_or_op2 | op1_xor_op2 =>
status.zero <= test_zero(res_reg);
status.carry <= stat_reg.carry;
result <= lf_res;
when shl_op | shr_op | rol_op | ror_op | rolc_op | rorc_op =>
status.zero <= test_zero(res_reg);
status.carry <= sh_cy;
result <= sh_res;
when swap_op =>
result <= op1_in(op1_in'left-op1_in'length/2 downto op1_in'right) & op1_in(op1_in'left downto op1_in'right+op1_in'length/2);
status <= stat_reg;
when others =>
result <= op2_in;
status.zero <= stat_reg.zero;
status.carry <= stat_reg.carry or cy_in;
end case;
end process;
--------------------------------------------------------------------------
proc_alu_in:
process(opsel, op1_in, stat_reg)
begin
add_subn <= '-';
sum_cy_in <= '-';
sh_cy_in <= '-';
left_shift <= '-';
case opsel is
when op1_add_op2 =>
sum_cy_in <= '0';
add_subn <= '1';
when op1_sub_op2 =>
sum_cy_in <= '0';
add_subn <= '0';
when op1_addc_op2 =>
sum_cy_in <= stat_reg.carry;
add_subn <= '1';
when op1_subc_op2 =>
sum_cy_in <= stat_reg.carry;
add_subn <= '0';
when shl_op =>
sh_cy_in <= '0';
left_shift <= '1';
when shr_op =>
sh_cy_in <= '0';
left_shift <= '0';
when rol_op =>
sh_cy_in <= op1_in(op1_in'left);
left_shift <= '1';
when ror_op =>
sh_cy_in <= op1_in(op1_in'right);
left_shift <= '0';
when rolc_op =>
sh_cy_in <= stat_reg.carry;
left_shift <= '1';
when rorc_op =>
sh_cy_in <= stat_reg.carry;
left_shift <= '0';
when others => null;
end case;
end process;
--------------------------------------------------------------------------
proc_res_reg:
process(clk, rst, op_en, stat_load, res_reg, stat_reg)
begin
if rst = '1' then
res_reg <= (others => '0');
stat_reg <= (others => '0');
elsif rising_edge(clk) then
if op_en = '1' then
res_reg <= result;
stat_reg <= status;
elsif stat_load = '1' then
stat_reg <= stat_in;
end if;
end if;
res_out <= res_reg;
stat_out <= stat_reg;
end process;
--------------------------------------------------------------------------
alu_addsub:
process(op1_in, op2_in, sum_cy_in, add_subn)
variable sum : unsigned(data_width+1 downto 0);
variable op1, op2 : unsigned(data_width+1 downto 0);
begin
if add_subn = '1' then
op1 := '0' & op1_in & '1';
op2 := '0' & op2_in & sum_cy_in;
sum := op1 + op2;
else
op1 := '0' & op1_in & not sum_cy_in;
op2 := '0' & op2_in & '1';
sum := op1 - op2;
end if;
-- Form sum + carry
sum_res <= sum(data_width downto 1);
sum_cy <= sum(sum'left);
end process;
--------------------------------------------------------------------------
end Behavioral;
-85
View File
@@ -1,85 +0,0 @@
--------------------------------------------------------------------------
-- Project: JCPU, a portable 8-bit RISC CPU written in VHDL
-- This file: On-chip RAM
--
-- Copyright (C) 2007 J. Ahrensfeld
--
-- This program is free software: you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
-- the Free Software Foundation, either version 3 of the License, or
-- (at your option) any later version.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU General Public License for more details.
--
-- You should have received a copy of the GNU General Public License
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
--
-- For questions and ideas, please contact the author at jens@jayfield.org
--
--------------------------------------------------------------------------
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.numeric_std.ALL;
use work.cpu_pkg.all;
entity chipram is
Generic (
addr_width : integer := 3;
data_width : integer := 8
);
Port (
clka : in STD_LOGIC;
clkb : in STD_LOGIC;
en_a : in STD_LOGIC;
en_b : in STD_LOGIC;
we_a : in STD_LOGIC;
we_b : in STD_LOGIC;
addr_a : in unsigned (addr_width-1 downto 0);
addr_b : in unsigned (addr_width-1 downto 0);
din_a : in unsigned (data_width-1 downto 0);
din_b : in unsigned (data_width-1 downto 0);
dout_a : out unsigned (data_width-1 downto 0);
dout_b : out unsigned (data_width-1 downto 0)
);
end chipram;
architecture Behavioral of chipram is
constant depth : integer := 2**addr_width;
type RAMtype is array (0 to depth-1) of unsigned (data_width-1 downto 0);
shared variable RAM : RAMtype;
begin
process (clka)
begin
if clka'event and clka = '1' then
if en_a = '1' then
if we_a = '1' then
RAM(to_integer(addr_a)) := din_a;
end if;
dout_a <= RAM(to_integer(addr_a));
end if;
end if;
end process;
process (clkb)
begin
if clkb'event and clkb = '1' then
if en_b = '1' then
if we_b = '1' then
RAM(to_integer(addr_b)) := din_b;
end if;
dout_b <= RAM(to_integer(addr_b));
end if;
end if;
end process;
end Behavioral;
-123
View File
@@ -1,123 +0,0 @@
--------------------------------------------------------------------------
-- Project: JCPU, a portable 8-bit RISC CPU written in VHDL
-- This file: On-Chip registers
--
-- Copyright (C) 2007 J. Ahrensfeld
--
-- This program is free software: you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
-- the Free Software Foundation, either version 3 of the License, or
-- (at your option) any later version.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU General Public License for more details.
--
-- You should have received a copy of the GNU General Public License
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
--
-- For questions and ideas, please contact the author at jens@jayfield.org
--
--------------------------------------------------------------------------
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.numeric_std.ALL;
use work.cpu_pkg.all;
entity chipreg is
Port (
rst : in STD_LOGIC;
clk : in STD_LOGIC;
we : in STD_LOGIC;
addr : in dmem_addr_t;
din : in dmem_data_t;
dout : out dmem_data_t;
ctrl_in : in creg_ctrl_in_t;
ctrl_out : out creg_ctrl_out_t
);
end chipreg;
architecture Behavioral of chipreg is
signal reg_page_sel : page_sel_t;
signal reg_int_ctrl : int_ctrl_in_t;
signal reg_stk_high : unsigned(IMEM_ADDR_WIDTH-DMEM_ADDR_WIDTH-1 downto 0);
signal reg_cmem_high : unsigned(IMEM_ADDR_WIDTH-DMEM_ADDR_WIDTH-1 downto 0);
begin
proc_assign_ctrl_lines:
process (clk)
begin
if rising_edge(clk) then
ctrl_out.page_sel <= reg_page_sel;
ctrl_out.int_ctrl <= reg_int_ctrl;
ctrl_out.stk_high <= reg_stk_high;
ctrl_out.cmem_high <= reg_cmem_high;
end if;
end process;
proc_reg_write:
process (rst, clk)
begin
if rst = '1' then
reg_stk_high <= (others => '0');
reg_cmem_high <= (others => '0');
reg_page_sel <= (others => '0');
reg_int_ctrl.enable <= '0';
reg_int_ctrl.polarity <= '1';
reg_int_ctrl.edge_sens <= '1';
elsif rising_edge(clk) then
reg_int_ctrl.request <= '0';
if we = '1' then
case addr is
when X"01" =>
reg_page_sel(page_sel_t'range) <= din(page_sel_t'range);
when X"03" =>
reg_int_ctrl.enable <= din(0);
reg_int_ctrl.polarity <= din(1);
reg_int_ctrl.edge_sens <= din(2);
reg_int_ctrl.request <= din(7);
when X"04" =>
reg_cmem_high <= din(IMEM_ADDR_WIDTH-DMEM_ADDR_WIDTH-1 downto 0);
when X"05" =>
reg_stk_high <= din(IMEM_ADDR_WIDTH-DMEM_ADDR_WIDTH-1 downto 0);
when others => null;
end case;
end if;
end if;
end process;
proc_reg_read:
process (clk)
begin
if rising_edge(clk) then
case addr is
when X"00" => -- Revison
dout <= to_unsigned(REVISION, dmem_data_t'length);
when X"01" => -- Control 0
dout <= (7 downto page_sel_t'length => '0') & reg_page_sel;
when X"02" => -- CPU status
dout <= "000000" & ctrl_in.alu.carry & ctrl_in.alu.zero;
when X"03" => -- Interrupt control
dout <= "00000" & reg_int_ctrl.edge_sens & reg_int_ctrl.polarity & reg_int_ctrl.enable;
when X"04" => -- Upper stack bits out
dout <= "0000" & reg_cmem_high;
when X"05" => -- Upper cmem bits out
dout <= "0000" & reg_stk_high;
when others =>
if addr(0) = '0' then
dout <= X"DE";
else
dout <= X"AD";
end if;
end case;
end if;
end process;
end Behavioral;
-566
View File
@@ -1,566 +0,0 @@
--------------------------------------------------------------------------
-- Project: JCPU, a portable 8-bit RISC CPU written in VHDL
-- This file: JCPU top file
--
-- Copyright (C) 2007 J. Ahrensfeld
--
-- This program is free software: you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
-- the Free Software Foundation, either version 3 of the License, or
-- (at your option) any later version.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU General Public License for more details.
--
-- You should have received a copy of the GNU General Public License
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
--
-- For questions and ideas, please contact the author at jens@jayfield.org
--
--------------------------------------------------------------------------
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.numeric_std.ALL;
use work.cpu_pkg.all;
entity cpu is
Generic (
use_instr_register : boolean := false;
use_ctrl_rom : boolean := true
);
Port (
rst : in STD_LOGIC;
clk : in STD_LOGIC;
ce : in STD_LOGIC;
int_in : in STD_LOGIC;
int_ack : out STD_LOGIC;
xmem_wait : in STD_LOGIC;
xmem_we : out STD_LOGIC;
xmem_re : out STD_LOGIC;
instr_din : in unsigned (IMEM_DATA_WIDTH-1 downto 0);
instr_addr : out unsigned (IMEM_ADDR_WIDTH-1 downto 0);
xmem_din : in unsigned (DMEM_DATA_WIDTH-1 downto 0);
xmem_dout : out unsigned (DMEM_DATA_WIDTH-1 downto 0);
xmem_addr : out unsigned (DMEM_ADDR_WIDTH-1 downto 0);
io_sel : out std_logic
);
end cpu;
architecture rtl of cpu is
COMPONENT stack_ctrl
GENERIC (
addr_width : integer
);
Port (
rst : in STD_LOGIC;
clk : in STD_LOGIC;
push : in STD_LOGIC;
pop : in STD_LOGIC;
din : in inst_addr_t;
dout : out inst_addr_t;
mem_we : out STD_LOGIC;
ptr_out : out unsigned (addr_width-1 downto 0)
);
END COMPONENT;
COMPONENT pc
Port (
rst : in STD_LOGIC;
clk : in STD_LOGIC;
inc : in STD_LOGIC;
load : in STD_LOGIC;
pc_in : in inst_addr_t;
pc_out : out inst_addr_t;
pc_next : out inst_addr_t
);
END COMPONENT;
COMPONENT dpath_ctrl
GENERIC (
use_rom : boolean
);
Port (
inst_in : in inst_t;
iphase_in : in iphase_t;
status_in : in cpu_status_t;
ctrl_out : out dpath_ctrl_out_t;
idout : out inst_addr_t;
ddout : out dmem_data_t
);
END COMPONENT;
COMPONENT int_ctrl
Port (
rst : in STD_LOGIC;
clk : in STD_LOGIC;
ctrl_in : in int_ctrl_in_t;
int_in : in STD_LOGIC;
int_exit : in STD_LOGIC;
iphase_in : in iphase_t;
int_ack_out : out STD_LOGIC;
stat_save_out : out STD_LOGIC;
stat_rest_out : out STD_LOGIC;
pc_addr_out : out inst_addr_t;
pc_load_out : out STD_LOGIC;
stk_push_out : out STD_LOGIC;
stk_pop_out : out STD_LOGIC
);
END COMPONENT;
COMPONENT reg_dual
GENERIC (
addr_width : integer;
data_width : integer
);
Port (
clk : in STD_LOGIC;
we_a : in STD_LOGIC;
ptr_a : in reg_ptr_t;
ptr_b : in reg_ptr_t;
din_a : in unsigned (data_width-1 downto 0);
dout_a : out unsigned (data_width-1 downto 0);
dout_b : out unsigned (data_width-1 downto 0)
);
END COMPONENT;
COMPONENT chipram
GENERIC (
addr_width : integer;
data_width : integer
);
Port (
clka : in STD_LOGIC;
clkb : in STD_LOGIC;
en_a : in STD_LOGIC;
en_b : in STD_LOGIC;
we_a : in STD_LOGIC;
we_b : in STD_LOGIC;
addr_a : in unsigned (addr_width-1 downto 0);
addr_b : in unsigned (addr_width-1 downto 0);
din_a : in unsigned (data_width-1 downto 0);
din_b : in unsigned (data_width-1 downto 0);
dout_a : out unsigned (data_width-1 downto 0);
dout_b : out unsigned (data_width-1 downto 0)
);
END COMPONENT;
COMPONENT chipreg
Port (
rst : in STD_LOGIC;
clk : in STD_LOGIC;
we : in STD_LOGIC;
addr : in dmem_addr_t;
din : in dmem_data_t;
dout : out dmem_data_t;
ctrl_in : in creg_ctrl_in_t;
ctrl_out : out creg_ctrl_out_t
);
END COMPONENT;
COMPONENT alu
GENERIC (
data_width : integer := 8
);
Port (
rst : in STD_LOGIC;
clk : in STD_LOGIC;
op_en : in STD_LOGIC;
cy_in : in STD_LOGIC;
op1_in : in unsigned (data_width-1 downto 0);
op2_in : in unsigned (data_width-1 downto 0);
opsel : in alu_op_t;
res_out : out unsigned (data_width-1 downto 0);
stat_load : in STD_LOGIC;
stat_in : in alu_status_t;
stat_out : out alu_status_t
);
END COMPONENT;
signal cpu_status, status_reg : cpu_status_t; -- := cpu_status_t(others => '0');
signal ctrl : dpath_ctrl_out_t;
signal stk_out : inst_addr_t;
signal stk_in : inst_addr_t;
signal stk_reg : inst_addr_t;
signal pc_in, pc_out, pc_next, idata, int_pc_addr : inst_addr_t;
signal iphase : iphase_t;
signal const_data, reg_a_dout, reg_b_dout : dmem_data_t;
signal reg_din : dmem_data_t;
signal alu_op1, alu_op2, alu_result : dmem_data_t;
signal alu_status : alu_status_t;
signal pc_inc, pc_load, cpu_active, stk_we, cmem_we, creg_we : STD_LOGIC;
signal ctrl_inst : inst_t;
signal ctrl_iphase : iphase_t;
signal was_pcld, was_pop2pc, int_pc_load, int_stk_push, int_stk_pop, stk_push, stk_pop : STD_LOGIC;
signal status_save, status_restore : STD_LOGIC;
signal creg_dout : dmem_data_t;
signal cmem_din, cmem_dout : inst_addr_t;
signal stk_addr, cmem_addr : unsigned(CHIPRAM_SIZE_BITS-1 downto 0);
signal stk_ptr : unsigned(STACK_SIZE_BITS-1 downto 0);
signal creg_ctrl_out : creg_ctrl_out_t;
signal creg_ctrl_in : creg_ctrl_in_t;
signal irq_out : std_logic;
signal xio_sel, cio_sel : std_logic;
signal mem_data : dmem_data_t;
signal mem_addr : dmem_data_t;
begin
io_sel <= xio_sel;
instr_addr <= pc_out;
pc_inc <= cpu_active and ctrl.lines.pc_inc;
stk_addr <= '0' & stk_ptr;
cpu_status.alu <= alu_status;
cpu_status.xmem_wait <= xmem_wait;
creg_ctrl_in.alu <= alu_status;
xmem_dout <= mem_data;
xmem_addr <= mem_addr;
cmem_din <= creg_ctrl_out.cmem_high & mem_data;
cmem_addr <= '1' & creg_ctrl_out.page_sel & mem_addr(MIN(cmem_addr'length-creg_ctrl_out.page_sel'length-1, mem_addr'length)-1 downto 0);
--------------------------------------------------------------------
mem_ctrl_lines:
process(ctrl.lines)
begin
xio_sel <= '0';
xmem_re <= '0';
xmem_we <= '0';
cio_sel <= '0';
cmem_we <= '0';
creg_we <= '0';
case ctrl.lines.mem_access is
when xmem_access =>
xmem_re <= ctrl.lines.mem_read;
xmem_we <= ctrl.lines.mem_write;
when xio_access =>
xio_sel <= '1';
xmem_re <= ctrl.lines.mem_read;
xmem_we <= ctrl.lines.mem_write;
when cmem_access =>
cmem_we <= ctrl.lines.mem_write;
when cio_access =>
cio_sel <= '1';
creg_we <= ctrl.lines.mem_write;
when others => null;
end case;
end process;
iphase_counter:
process(rst, clk, ce)
variable pos : integer;
begin
if rst = '1' then
iphase <= iphase_t'low;
cpu_active <= '0';
elsif rising_edge(clk) then
cpu_active <= '0';
if ce = '1' then
cpu_active <= '1';
if iphase = iphase_t'high then
iphase <= iphase_t'low;
else
iphase <= iphase + 1;
end if;
end if;
end if;
end process;
gen_instr_reg:
if use_instr_register = true generate
instr_reg:
process (rst, clk, ce)
begin
if rst = '1' then
ctrl_inst <= (others => '0');
ctrl_iphase <= 0;
elsif rising_edge(clk) and ce = '1' then
ctrl_inst <= instr_din;
ctrl_iphase <= iphase;
end if;
end process;
end generate;
gen_instr_direct:
if use_instr_register = false generate
ctrl_inst <= instr_din;
ctrl_iphase <= iphase;
end generate;
status_register:
process(clk, status_save)
begin
if rising_edge(clk) and status_save = '1' then
status_reg.alu <= alu_status;
end if;
end process;
pc_pushpop:
process(ctrl.lines, int_pc_load, int_stk_push, int_stk_pop, was_pop2pc)
begin
pc_load <= ctrl.lines.pc_load or int_pc_load;
stk_push <= (ctrl.lines.stk_pushd or ctrl.lines.stk_push) or (int_stk_push and not was_pop2pc);
stk_pop <= ctrl.lines.stk_popd or int_stk_pop or (ctrl.lines.stk_pop and not int_pc_load);
end process;
lines_delay:
process(clk)
begin
if rising_edge(clk) then
was_pcld <= ctrl.lines.pc_load;
was_pop2pc <= ctrl.lines.stk_pop and ctrl.lines.pc_load;
end if;
end process;
stk_mux:
process(ctrl.lines, was_pcld, int_stk_push, pc_next, idata, reg_a_dout, creg_ctrl_out)
begin
if was_pcld = '1' and int_stk_push = '1' then
stk_in <= idata;
elsif ctrl.lines.stk_pushd = '1' then
stk_in <= creg_ctrl_out.stk_high & reg_a_dout;
else
stk_in <= pc_next;
end if;
end process;
pc_mux:
process(ctrl.lines, int_pc_load, int_stk_pop, idata, int_pc_addr, stk_out)
begin
pc_in <= stk_out;
if int_pc_load = '1' then
if int_stk_pop = '0' then
pc_in <= int_pc_addr;
end if;
elsif ctrl.lines.pc_load = '1' then
if ctrl.lines.stk_pop = '0' then
pc_in <= idata;
end if;
end if;
end process;
mem_data_mux:
process(ctrl.lines.ddata_src_sel, reg_a_dout, reg_b_dout, const_data, creg_ctrl_out)
begin
case ctrl.lines.ddata_src_sel is
when reg_a =>
mem_data <= reg_a_dout;
when reg_b =>
mem_data <= reg_b_dout;
when const =>
mem_data <= const_data;
when others =>
mem_data <= const_data;
end case;
end process;
mem_addr_mux:
process(ctrl.lines.daddr_src_sel, reg_a_dout, reg_b_dout, const_data, creg_ctrl_out.page_sel)
begin
case ctrl.lines.daddr_src_sel is
when reg_a =>
mem_addr <= reg_a_dout;
when reg_b =>
mem_addr <= reg_b_dout;
when const =>
mem_addr <= const_data;
when others =>
mem_addr <= const_data;
end case;
end process;
reg_in_mux:
process(ctrl.lines.reg_src_sel, cio_sel, xmem_din, alu_result, stk_out, cmem_dout, creg_dout)
variable data : dmem_data_t;
begin
case ctrl.lines.reg_src_sel is
when xmem_src =>
data := xmem_din;
when cmem_src =>
if cio_sel = '0' then
data := cmem_dout(dmem_data_t'range);
else
data := creg_dout(dmem_data_t'range);
end if;
when stk_src =>
data := stk_out(dmem_data_t'range);
when others =>
data := alu_result;
end case;
reg_din <= data;
end process;
alu_op1_mux:
process(ctrl.lines.alu_op1_src_sel, reg_a_dout, reg_b_dout, const_data)
variable data : dmem_data_t;
begin
case ctrl.lines.alu_op1_src_sel is
when reg_a =>
data := reg_a_dout;
when reg_b =>
data := reg_b_dout;
when others =>
data := const_data;
end case;
alu_op1 <= data;
end process;
alu_op2_mux:
process(ctrl.lines.alu_op2_src_sel, reg_a_dout, reg_b_dout, const_data)
variable data : dmem_data_t;
begin
case ctrl.lines.alu_op2_src_sel is
when reg_a =>
data := reg_a_dout;
when reg_b =>
data := reg_b_dout;
when others =>
data := const_data;
end case;
alu_op2 <= data;
end process;
--------------------------------------------------------------------
inst_stack_ctrl: stack_ctrl
GENERIC MAP (
addr_width => STACK_SIZE_BITS
)
PORT MAP(
rst => rst,
clk => clk,
push => stk_push,
pop => stk_pop,
dout => stk_reg,
din => stk_in,
ptr_out => stk_ptr,
mem_we => stk_we
);
inst_pc: pc
PORT MAP(
rst => rst,
clk => clk,
inc => pc_inc,
load => pc_load,
pc_in => pc_in,
pc_out => pc_out,
pc_next => pc_next
);
inst_dpath_ctrl: dpath_ctrl
GENERIC MAP (
use_rom => use_ctrl_rom
)
PORT MAP(
inst_in => ctrl_inst,
iphase_in => ctrl_iphase,
status_in => cpu_status,
ctrl_out => ctrl,
ddout => const_data,
idout => idata
);
inst_int_ctrl: int_ctrl
PORT MAP(
rst => rst,
clk => clk,
ctrl_in => creg_ctrl_out.int_ctrl,
int_in => int_in,
int_ack_out => int_ack,
int_exit => ctrl.lines.int_exit,
iphase_in => ctrl_iphase,
stat_save_out => status_save,
stat_rest_out => status_restore,
pc_addr_out => int_pc_addr,
pc_load_out => int_pc_load,
stk_push_out => int_stk_push,
stk_pop_out => int_stk_pop
);
inst_reg_ab: reg_dual
GENERIC MAP (
addr_width => REG_SIZE_BITS,
data_width => DMEM_DATA_WIDTH
)
PORT MAP(
clk => clk,
we_a => ctrl.lines.reg_we,
ptr_a => ctrl.reg_a_ptr,
ptr_b => ctrl.reg_b_ptr,
din_a => reg_din,
dout_a => reg_a_dout,
dout_b => reg_b_dout
);
inst_chipram: chipram
GENERIC MAP (
addr_width => CHIPRAM_SIZE_BITS,
data_width => IMEM_ADDR_WIDTH
)
PORT MAP(
clka => clk,
clkb => clk,
en_a => cpu_active,
en_b => cpu_active,
we_a => stk_we,
we_b => cmem_we,
addr_a => stk_addr,
addr_b => cmem_addr,
din_a => stk_reg,
din_b => cmem_din,
dout_a => stk_out,
dout_b => cmem_dout
);
inst_chipreg: chipreg
PORT MAP(
rst => rst,
clk => clk,
we => creg_we,
addr => mem_addr,
din => mem_data,
dout => creg_dout,
ctrl_in => creg_ctrl_in,
ctrl_out => creg_ctrl_out
);
inst_alu: alu
GENERIC MAP (
data_width => DMEM_DATA_WIDTH
)
PORT MAP(
rst => rst,
clk => clk,
op_en => ctrl.lines.alu_load,
cy_in => ctrl.lines.alu_cy_in,
op1_in => alu_op1,
op2_in => alu_op2,
opsel => ctrl.lines.alu_opsel,
res_out => alu_result,
stat_load => status_restore,
stat_in => status_reg.alu,
stat_out => alu_status
);
end rtl;
-904
View File
@@ -1,904 +0,0 @@
--------------------------------------------------------------------------
-- Project: JCPU, a portable 8-bit RISC CPU written in VHDL
-- This file: Types, constants and functions for JCPU
--
-- Copyright (C) 2007 J. Ahrensfeld
--
-- This program is free software: you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
-- the Free Software Foundation, either version 3 of the License, or
-- (at your option) any later version.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU General Public License for more details.
--
-- You should have received a copy of the GNU General Public License
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
--
-- For questions and ideas, please contact the author at jens@jayfield.org
--
--------------------------------------------------------------------------
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.numeric_std.ALL;
package cpu_pkg is
-- Revision of the CPU
constant REVISION : integer := 4;
-- Chipram depth (valid values 9..floor(log2(BlockRamBytes)))
constant CHIPRAM_SIZE_BITS : integer := 10;
-- Chipregister file depth
constant CHIPREG_SIZE_BITS : integer := 8;
-- Number of registers (16 registers fixed)
constant REG_SIZE_BITS : integer := 4;
-- Instruction memory
constant IMEM_ADDR_WIDTH : integer := 12;
-- Data memory
constant DMEM_DATA_WIDTH : integer := 8;
constant DMEM_ADDR_WIDTH : integer := 8;
-- Instruction format
constant INST_OPCODE_WIDTH : integer := 6;
constant IMEM_DATA_WIDTH : integer := INST_OPCODE_WIDTH + DMEM_DATA_WIDTH + REG_SIZE_BITS;
-- Microcode ROM
constant MUCODE_ADDR_WIDTH : integer := 10;
-- Stack depth (uses lower half of CHIPRAM)
constant STACK_SIZE_BITS : integer := CHIPRAM_SIZE_BITS-1;
--Types
subtype iphase_t is integer range 0 to 1;
type mem_access_t is (cmem_access, xmem_access, cio_access, xio_access);
type reg_src_t is (alu_src, stk_src, cmem_src, xmem_src);
type alu_src_t is (reg_a, reg_b, const);
type ddata_src_t is (reg_a, reg_b, const);
type daddr_src_t is (reg_a, reg_b, const);
subtype instr_name_t is string(1 to 12);
type instr_name_array_t is array (0 to 63) of instr_name_t;
subtype opcode_t is unsigned (INST_OPCODE_WIDTH-1 downto 0);
subtype inst_data_t is unsigned (IMEM_ADDR_WIDTH-1 downto 0);
subtype inst_addr_t is unsigned (IMEM_ADDR_WIDTH-1 downto 0);
subtype inst_t is unsigned (IMEM_DATA_WIDTH-1 downto 0);
subtype dmem_data_t is unsigned (DMEM_DATA_WIDTH-1 downto 0);
subtype dmem_addr_t is unsigned (DMEM_DATA_WIDTH-1 downto 0);
subtype reg_ptr_t is unsigned (3 downto 0);
type dmem_array_t is array (natural range <>) of dmem_data_t;
type instr_addr_array is array (integer range <>) of inst_addr_t;
subtype page_sel_t is unsigned (CHIPRAM_SIZE_BITS-DMEM_DATA_WIDTH-2 downto 0);
type alu_op_t is
(
pass_op2,
op1_add_op2,
op1_sub_op2,
op1_addc_op2,
op1_subc_op2,
op1_and_op2,
op1_or_op2,
op1_xor_op2,
swap_op,
shl_op,
shr_op,
rol_op,
ror_op,
rolc_op,
rorc_op
);
type alu_status_t is record
zero : STD_LOGIC;
carry : STD_LOGIC;
end record;
type cpu_status_t is record
alu : alu_status_t;
xmem_wait : STD_LOGIC;
end record;
type ctrl_lines_t is record
reg_we : STD_LOGIC;
reg_src_sel : reg_src_t;
alu_op1_src_sel : alu_src_t;
alu_op2_src_sel : alu_src_t;
alu_opsel : alu_op_t;
alu_load : STD_LOGIC;
alu_cy_in : STD_LOGIC;
ddata_src_sel : ddata_src_t;
daddr_src_sel : daddr_src_t;
pc_load : STD_LOGIC;
pc_inc : STD_LOGIC;
stk_push : STD_LOGIC;
stk_pop : STD_LOGIC;
stk_pushd : STD_LOGIC;
stk_popd : STD_LOGIC;
mem_access : mem_access_t;
mem_read : STD_LOGIC;
mem_write : STD_LOGIC;
int_exit : STD_LOGIC;
end record;
type dpath_ctrl_out_t is record
lines : ctrl_lines_t;
reg_a_ptr : reg_ptr_t;
reg_b_ptr : reg_ptr_t;
end record;
type int_ctrl_in_t is record
enable : std_logic;
polarity : std_logic;
edge_sens : std_logic;
request : std_logic;
end record;
type creg_ctrl_out_t is record
page_sel : page_sel_t;
int_ctrl : int_ctrl_in_t;
stk_high : unsigned(IMEM_ADDR_WIDTH-DMEM_ADDR_WIDTH-1 downto 0);
cmem_high : unsigned(IMEM_ADDR_WIDTH-DMEM_ADDR_WIDTH-1 downto 0);
end record;
type creg_ctrl_in_t is record
alu : alu_status_t;
end record;
type murom_t is array (0 to integer(2**MUCODE_ADDR_WIDTH)-1) of ctrl_lines_t;
constant instr_name_array : instr_name_array_t :=
(
"NOP ", -- 00
"HALT ", -- 01
"MOV|R|R ", -- 02
"MOV|R|K ", -- 03
"MOVX|R|Ri ", -- 04
"MOVX|R|Ki ", -- 05
"MOVX|Ri|R ", -- 06
"MOVX|Ri|K ", -- 07
"MOVX|Ki|R ", -- 08
"MOVC|R|Ri ", -- 09
"MOVC|R|Ki ", -- 0A
"MOVC|Ri|R ", -- 0B
"MOVC|Ri|K ", -- 0C
"MOVC|Ki|R ", -- 0D
"CMP|R|R ", -- 0E
"CMP|R|K ", -- 0F
"ADD|R|R ", -- 10
"ADD|R|K ", -- 11
"ADDC|R|R ", -- 12
"ADDC|R|K ", -- 13
"SUB|R|R ", -- 14
"SUB|R|K ", -- 15
"SUBC|R|R ", -- 16
"SUBC|R|K ", -- 17
"AND|R|R ", -- 18
"AND|R|K ", -- 19
"OR|R|R ", -- 1A
"OR|R|K ", -- 1B
"XOR|R|R ", -- 1C
"XOR|R|K ", -- 1D
"SHL|R ", -- 1E
"SHR|R ", -- 1F
"ROL|R ", -- 20
"ROR|R ", -- 21
"ROLC|R ", -- 22
"RORC|R ", -- 23
"XOUT|Ki|R ", -- 24
"XOUT|Ri|K ", -- 25
"COUT|Ki|R ", -- 26
"COUT|Ri|K ", -- 27
"XIN|R|Ki ", -- 28
"CIN|R|Ki ", -- 29
"SWAP|R ", -- 2A
"SETC ", -- 2B
"UNDEF ", -- 2C
"UNDEF ", -- 2D
"SUB|K|R ", -- 2E
"SUBC|K|R ", -- 2F
"JMP|K ", -- 30
"JZ|K ", -- 31
"JNZ|K ", -- 32
"JC|K ", -- 33
"JNC|K ", -- 34
"JLT|K ", -- 35
"JGT|K ", -- 36
"JLE|K ", -- 37
"JGE|K ", -- 38
"JEQ|K ", -- 39
"JNE|K ", -- 3A
"CALL|K ", -- 3B
"PUSH|R ", -- 3C
"POP|R ", -- 3D
"RET ", -- 3E
"RETI " -- 3F
);
-- Functions
function Instr(opcode : opcode_t) return inst_t;
function Instr(opcode : opcode_t; data : inst_data_t) return inst_t;
function Instr(opcode : opcode_t; data : inst_data_t; reg : integer) return inst_t;
function Instr(opcode : opcode_t; reg_a : integer) return inst_t;
function Instr(opcode : opcode_t; reg_a, reg_b : integer) return inst_t;
function Instr(opcode : opcode_t; reg_a, reg_b, reg_c : integer) return inst_t;
function ctrl_lines_default return ctrl_lines_t;
function idecoder(instr_name : instr_name_t; iphase : iphase_t; status : cpu_status_t) return ctrl_lines_t;
function idecoder(opcode : opcode_t; iphase : iphase_t; status : cpu_status_t) return ctrl_lines_t;
function gen_murom return murom_t;
function get_muromaddr (opcode : opcode_t; iphase : iphase_t; status : cpu_status_t) return unsigned;
function MIN (X, Y: INTEGER) return INTEGER;
function MAX (X, Y: INTEGER) return INTEGER;
end cpu_pkg;
package body cpu_pkg is
function Instr(opcode : opcode_t) return inst_t is
variable inst : inst_t := (others => '0');
begin
inst(inst_t'length-1 downto inst_t'length-opcode_t'length) := opcode;
return inst;
end Instr;
function Instr(opcode : opcode_t; data : inst_data_t) return inst_t is
variable inst : inst_t := (others => '0');
begin
inst(inst_t'length-1 downto inst_t'length-opcode_t'length) := opcode;
inst(inst_t'length-opcode_t'length-1 downto inst_t'length-opcode_t'length-inst_addr_t'length) := data;
return inst;
end Instr;
function Instr(opcode : opcode_t; data : inst_data_t; reg : integer) return inst_t is
variable inst : inst_t := (others => '0');
begin
inst(inst_t'length-1 downto inst_t'length-opcode_t'length) := opcode;
inst(inst_t'length-opcode_t'length-1 downto inst_t'length-opcode_t'length-inst_data_t'length) := data;
inst(reg_ptr_t'length-1 downto 0) := reg_ptr_t(to_unsigned(reg, reg_ptr_t'length));
return inst;
end Instr;
function Instr(opcode : opcode_t; reg_a : integer) return inst_t is
variable inst : inst_t := (others => '0');
begin
inst(inst_t'length-1 downto inst_t'length-opcode_t'length) := opcode;
inst(reg_ptr_t'length-1 downto 0) := reg_ptr_t(to_unsigned(reg_a, reg_ptr_t'length));
return inst;
end Instr;
function Instr(opcode : opcode_t; reg_a, reg_b : integer) return inst_t is
variable inst : inst_t := (others => '0');
begin
inst(inst_t'length-1 downto inst_t'length-opcode_t'length) := opcode;
inst(2*(reg_ptr_t'length)-1 downto reg_ptr_t'length) := reg_ptr_t(to_unsigned(reg_b, reg_ptr_t'length));
inst(reg_ptr_t'length-1 downto 0) := reg_ptr_t(to_unsigned(reg_a, reg_ptr_t'length));
return inst;
end Instr;
function Instr(opcode : opcode_t; reg_a, reg_b, reg_c : integer) return inst_t is
variable inst : inst_t := (others => '0');
begin
inst(inst_t'length-1 downto inst_t'length-opcode_t'length) := opcode;
inst(3*(reg_ptr_t'length)-1 downto 2*reg_ptr_t'length) := reg_ptr_t(to_unsigned(reg_c, reg_ptr_t'length));
inst(2*(reg_ptr_t'length)-1 downto reg_ptr_t'length) := reg_ptr_t(to_unsigned(reg_b, reg_ptr_t'length));
inst(reg_ptr_t'length-1 downto 0) := reg_ptr_t(to_unsigned(reg_a, reg_ptr_t'length));
return inst;
end Instr;
function ctrl_lines_default return ctrl_lines_t is
variable result : ctrl_lines_t;
begin
result.pc_load := '0';
result.pc_inc := '0';
result.stk_push := '0';
result.stk_pop := '0';
result.stk_pushd := '0';
result.stk_popd := '0';
result.reg_we := '0';
result.reg_src_sel := alu_src;
result.ddata_src_sel := reg_a;
result.daddr_src_sel := reg_b;
result.alu_opsel := pass_op2;
result.alu_op1_src_sel := reg_a;
result.alu_op2_src_sel := reg_b;
result.alu_load := '0';
result.alu_cy_in := '0';
result.mem_access := cmem_access;
result.mem_read := '0';
result.mem_write := '0';
result.int_exit := '0';
return result;
end ctrl_lines_default;
function idecoder(opcode : opcode_t; iphase : iphase_t; status : cpu_status_t) return ctrl_lines_t is
variable instr_name : instr_name_t;
begin
instr_name := instr_name_array(to_integer(opcode));
return idecoder(instr_name, iphase, status);
end idecoder;
function idecoder(instr_name : instr_name_t; iphase : iphase_t; status : cpu_status_t) return ctrl_lines_t is
variable result : ctrl_lines_t;
variable ze, cy, xmem_wait : STD_LOGIC;
begin
ze := status.alu.zero;
cy := status.alu.carry;
xmem_wait := status.xmem_wait;
result := ctrl_lines_default;
if iphase = 0 then
result.pc_inc := '1';
end if;
case instr_name is
when "HALT " =>
result.pc_inc := '0';
when "SETC " => -- carry <= 1
result.reg_src_sel := alu_src;
result.alu_opsel := pass_op2;
result.alu_op2_src_sel := reg_b;
result.alu_load := '1';
result.alu_cy_in := '1';
when "MOV|R|R " => -- R(a) <= R(b)
result.reg_src_sel := alu_src;
result.alu_opsel := pass_op2;
result.alu_op2_src_sel := reg_b;
result.alu_load := '1';
if iphase = 1 then
result.reg_we := '1';
end if;
when "MOV|R|K " => -- R(a) <= #kk
result.reg_src_sel := alu_src;
result.alu_opsel := pass_op2;
result.alu_op2_src_sel := const;
result.alu_load := '1';
if iphase = 1 then
result.reg_we := '1';
end if;
when "MOVC|Ri|R " => -- [R(b)] <= R(a)
result.mem_access := cmem_access;
result.daddr_src_sel := reg_b;
result.ddata_src_sel := reg_a;
if iphase = 0 then
result.mem_write := '1';
end if;
when "MOVC|Ri|K " => -- [R(a)] <= kk
result.mem_access := cmem_access;
result.daddr_src_sel := reg_a;
result.ddata_src_sel := const;
if iphase = 0 then
result.mem_write := '1';
end if;
when "COUT|Ri|K " => -- [R(a)] <= kk
result.mem_access := cio_access;
result.daddr_src_sel := reg_a;
result.ddata_src_sel := const;
if iphase = 0 then
result.mem_write := '1';
end if;
when "MOVC|R|Ri " => -- R(a) <= [R(b)]
result.mem_access := cmem_access;
result.reg_src_sel := cmem_src;
result.daddr_src_sel := reg_b;
if iphase = 1 then
result.reg_we := '1';
end if;
when "MOVC|R|Ki " => -- R(a) <= [#addr]
result.mem_access := cmem_access;
result.reg_src_sel := cmem_src;
result.daddr_src_sel := const;
if iphase = 1 then
result.reg_we := '1';
end if;
when "CIN|R|Ki " => -- R(a) <= [#addr]
result.mem_access := cio_access;
result.reg_src_sel := cmem_src;
result.daddr_src_sel := const;
if iphase = 1 then
result.reg_we := '1';
end if;
when "MOVC|Ki|R " => -- [#addr] <= R(a)
result.mem_access := cmem_access;
result.daddr_src_sel := const;
result.ddata_src_sel := reg_a;
if iphase = 0 then
result.mem_write := '1';
end if;
when "COUT|Ki|R " => -- [#addr] <= R(a)
result.mem_access := cio_access;
result.daddr_src_sel := const;
result.ddata_src_sel := reg_a;
if iphase = 0 then
result.mem_write := '1';
end if;
when "MOVX|Ri|R " => -- [R(b)] <= R(a)
result.mem_access := xmem_access;
result.daddr_src_sel := reg_b;
result.ddata_src_sel := reg_a;
if iphase = 0 then
result.mem_write := '1';
end if;
if xmem_wait = '1' then
result.mem_write := '1';
result.pc_inc := '0';
end if;
when "MOVX|Ri|K " => -- [R(a)] <= kk
result.mem_access := xmem_access;
result.daddr_src_sel := reg_a;
result.ddata_src_sel := const;
if iphase = 0 then
result.mem_write := '1';
end if;
if xmem_wait = '1' then
result.mem_write := '1';
result.pc_inc := '0';
end if;
when "XOUT|Ri|K " => -- [R(a)] <= kk
result.mem_access := xio_access;
result.daddr_src_sel := reg_a;
result.ddata_src_sel := const;
if iphase = 0 then
result.mem_write := '1';
end if;
if xmem_wait = '1' then
result.pc_inc := '0';
result.mem_write := '1';
end if;
when "MOVX|R|Ri " => -- R(a) <= [R(b)]
result.mem_access := xmem_access;
result.reg_src_sel := xmem_src;
result.daddr_src_sel := reg_b;
if iphase = 0 then
result.mem_read := '1';
end if;
if xmem_wait = '0' then
if iphase = 1 then
result.reg_we := '1';
end if;
else
result.pc_inc := '0';
result.mem_read := '1';
end if;
when "MOVX|R|Ki " => -- R(a) <= [#addr]
result.mem_access := xmem_access;
result.reg_src_sel := xmem_src;
result.daddr_src_sel := const;
if iphase = 0 then
result.mem_read := '1';
end if;
if xmem_wait = '0' then
if iphase = 1 then
result.reg_we := '1';
end if;
else
result.pc_inc := '0';
result.mem_read := '1';
end if;
when "XIN|R|Ki " => -- R(a) <= [#addr]
result.mem_access := xio_access;
result.reg_src_sel := xmem_src;
result.daddr_src_sel := const;
if iphase = 0 then
result.mem_read := '1';
end if;
if xmem_wait = '0' then
if iphase = 1 then
result.reg_we := '1';
end if;
else
result.pc_inc := '0';
result.mem_read := '1';
end if;
when "MOVX|Ki|R " => -- [#addr] <= R(a)
result.mem_access := xmem_access;
result.daddr_src_sel := const;
result.ddata_src_sel := reg_a;
if iphase = 0 then
result.mem_write := '1';
end if;
if xmem_wait = '1' then
result.pc_inc := '0';
result.mem_write := '1';
end if;
when "XOUT|Ki|R " => -- [#addr] <= R(a)
result.mem_access := xio_access;
result.daddr_src_sel := const;
result.ddata_src_sel := reg_a;
if iphase = 0 then
result.mem_write := '1';
end if;
if xmem_wait = '1' then
result.pc_inc := '0';
result.mem_write := '1';
end if;
when "ADD|R|R " => -- R(a) <= R(a) + R(b)
result.alu_opsel := op1_add_op2;
result.alu_op1_src_sel := reg_a;
result.alu_op2_src_sel := reg_b;
result.reg_src_sel := alu_src;
result.alu_load := '1';
if iphase = 1 then
result.reg_we := '1';
end if;
when "ADD|R|K " => -- R(a) <= R(a) + k
result.alu_opsel := op1_add_op2;
result.alu_op1_src_sel := reg_a;
result.alu_op2_src_sel := const;
result.reg_src_sel := alu_src;
result.alu_load := '1';
if iphase = 1 then
result.reg_we := '1';
end if;
when "ADDC|R|R " => -- R(a) <= R(a) + R(b)
result.alu_opsel := op1_addc_op2;
result.alu_op1_src_sel := reg_a;
result.alu_op2_src_sel := reg_b;
result.reg_src_sel := alu_src;
result.alu_load := '1';
if iphase = 1 then
result.reg_we := '1';
end if;
when "ADDC|R|K " => -- R(a) <= R(a) + k
result.alu_opsel := op1_addc_op2;
result.alu_op1_src_sel := reg_a;
result.alu_op2_src_sel := const;
result.reg_src_sel := alu_src;
result.alu_load := '1';
if iphase = 1 then
result.reg_we := '1';
end if;
when "SUB|R|R " => -- R(a) <= R(a) + R(b)
result.alu_opsel := op1_sub_op2;
result.alu_op1_src_sel := reg_a;
result.alu_op2_src_sel := reg_b;
result.reg_src_sel := alu_src;
result.alu_load := '1';
if iphase = 1 then
result.reg_we := '1';
end if;
when "SUB|R|K " => -- R(a) <= R(a) + k
result.alu_opsel := op1_sub_op2;
result.alu_op1_src_sel := reg_a;
result.alu_op2_src_sel := const;
result.reg_src_sel := alu_src;
result.alu_load := '1';
if iphase = 1 then
result.reg_we := '1';
end if;
when "SUB|K|R " => -- R(a) <= k - R(a)
result.alu_opsel := op1_sub_op2;
result.alu_op1_src_sel := const;
result.alu_op2_src_sel := reg_a;
result.reg_src_sel := alu_src;
result.alu_load := '1';
if iphase = 1 then
result.reg_we := '1';
end if;
when "SUBC|R|R " => -- R(a) <= R(a) + R(b)
result.alu_opsel := op1_subc_op2;
result.alu_op1_src_sel := reg_a;
result.alu_op2_src_sel := reg_b;
result.reg_src_sel := alu_src;
result.alu_load := '1';
if iphase = 1 then
result.reg_we := '1';
end if;
when "SUBC|R|K " => -- R(a) <= R(a) + k
result.alu_opsel := op1_subc_op2;
result.alu_op1_src_sel := reg_a;
result.alu_op2_src_sel := const;
result.reg_src_sel := alu_src;
result.alu_load := '1';
if iphase = 1 then
result.reg_we := '1';
end if;
when "SUBC|K|R " => -- R(a) <= K - R(a)
result.alu_opsel := op1_subc_op2;
result.alu_op1_src_sel := const;
result.alu_op2_src_sel := reg_a;
result.reg_src_sel := alu_src;
result.alu_load := '1';
if iphase = 1 then
result.reg_we := '1';
end if;
when "AND|R|R " => -- R(a) <= R(a) and R(b)
result.alu_opsel := op1_and_op2;
result.alu_op1_src_sel := reg_a;
result.alu_op2_src_sel := reg_b;
result.reg_src_sel := alu_src;
result.alu_load := '1';
if iphase = 1 then
result.reg_we := '1';
end if;
when "AND|R|K " => -- R(a) <= R(a) and k
result.alu_opsel := op1_and_op2;
result.alu_op1_src_sel := reg_a;
result.alu_op2_src_sel := const;
result.reg_src_sel := alu_src;
result.alu_load := '1';
if iphase = 1 then
result.reg_we := '1';
end if;
when "OR|R|R " => -- R(a) <= R(a) or R(b)
result.alu_opsel := op1_or_op2;
result.alu_op1_src_sel := reg_a;
result.alu_op2_src_sel := reg_b;
result.reg_src_sel := alu_src;
result.alu_load := '1';
if iphase = 1 then
result.reg_we := '1';
end if;
when "OR|R|K " => -- R(a) <= R(a) or R(b)
result.alu_opsel := op1_or_op2;
result.alu_op1_src_sel := reg_a;
result.alu_op2_src_sel := const;
result.reg_src_sel := alu_src;
result.alu_load := '1';
if iphase = 1 then
result.reg_we := '1';
end if;
when "XOR|R|R " => -- R(a) <= R(a) xor R(b)
result.alu_opsel := op1_xor_op2;
result.alu_op1_src_sel := reg_a;
result.alu_op2_src_sel := reg_b;
result.reg_src_sel := alu_src;
result.alu_load := '1';
if iphase = 1 then
result.reg_we := '1';
end if;
when "XOR|R|K " => -- R(a) <= R(a) xor R(b)
result.alu_opsel := op1_xor_op2;
result.alu_op1_src_sel := reg_a;
result.alu_op2_src_sel := const;
result.reg_src_sel := alu_src;
result.alu_load := '1';
if iphase = 1 then
result.reg_we := '1';
end if;
when "SWAP|R " => -- R(a) <= R(b)
result.reg_src_sel := alu_src;
result.alu_opsel := swap_op;
result.alu_op1_src_sel := reg_a;
result.alu_load := '1';
if iphase = 1 then
result.reg_we := '1';
end if;
when "SHL|R " => -- R(a) <= R(a) xor R(b)
result.reg_src_sel := alu_src;
result.alu_opsel := shl_op;
result.alu_op1_src_sel := reg_a;
result.alu_load := '1';
if iphase = 1 then
result.reg_we := '1';
end if;
when "SHR|R " => -- R(a) <= R(a) xor R(b)
result.reg_src_sel := alu_src;
result.alu_opsel := shr_op;
result.alu_op1_src_sel := reg_a;
result.alu_load := '1';
if iphase = 1 then
result.reg_we := '1';
end if;
when "ROL|R " => -- R(a) <= R(a) xor R(b)
result.reg_src_sel := alu_src;
result.alu_opsel := rol_op;
result.alu_op1_src_sel := reg_a;
result.alu_load := '1';
if iphase = 1 then
result.reg_we := '1';
end if;
when "ROR|R " => -- R(a) <= R(a) xor R(b)
result.reg_src_sel := alu_src;
result.alu_opsel := ror_op;
result.alu_op1_src_sel := reg_a;
result.alu_load := '1';
if iphase = 1 then
result.reg_we := '1';
end if;
when "ROLC|R " => -- R(a) <= R(a) xor R(b)
result.reg_src_sel := alu_src;
result.alu_opsel := rolc_op;
result.alu_op1_src_sel := reg_a;
result.alu_load := '1';
if iphase = 1 then
result.reg_we := '1';
end if;
when "RORC|R " => -- R(a) <= R(a) xor R(b)
result.reg_src_sel := alu_src;
result.alu_opsel := rorc_op;
result.alu_op1_src_sel := reg_a;
result.alu_load := '1';
if iphase = 1 then
result.reg_we := '1';
end if;
when "CMP|R|R " => --
result.alu_opsel := op1_sub_op2;
result.alu_op1_src_sel := reg_a;
result.alu_op2_src_sel := reg_b;
result.alu_load := '1';
when "CMP|R|K " => --
result.alu_opsel := op1_sub_op2;
result.alu_op1_src_sel := reg_a;
result.alu_op2_src_sel := const;
result.alu_load := '1';
when "JMP|K " => -- PC <= #addr
if iphase = 0 then
result.pc_load := '1';
end if;
when "JZ|K " => -- PC <= #addr, zero
if iphase = 0 then
if ze = '1' then
result.pc_load := '1';
end if;
end if;
when "JNZ|K " => -- PC <= #addr, !zero
if iphase = 0 then
if ze = '0' then
result.pc_load := '1';
end if;
end if;
when "JC|K " => -- PC <= #addr, carry
if iphase = 0 then
if cy = '1' then
result.pc_load := '1';
end if;
end if;
when "JNC|K " => -- PC <= #addr, !carry
if iphase = 0 then
if cy = '0' then
result.pc_load := '1';
end if;
end if;
when "JLT|K " => -- PC <= #addr, !carry
if iphase = 0 then
if cy = '1' then
result.pc_load := '1';
end if;
end if;
when "JGT|K " => --
if iphase = 0 then
if (cy or ze) = '0' then
result.pc_load := '1';
end if;
end if;
when "JLE|K " => --
if iphase = 0 then
if (cy xor ze) = '1' then
result.pc_load := '1';
end if;
end if;
when "JGE|K " => --
if iphase = 0 then
if (not cy or ze) = '1' then
result.pc_load := '1';
end if;
end if;
when "JEQ|K " => --
if iphase = 0 then
if ze = '1' then
result.pc_load := '1';
end if;
end if;
when "JNE|K " => --
if iphase = 0 then
if ze = '0' then
result.pc_load := '1';
end if;
end if;
when "PUSH|R " => -- push
if iphase = 0 then
result.stk_pushd := '1';
end if;
when "POP|R " => -- pop
result.reg_src_sel := stk_src;
if iphase = 0 then
result.stk_popd := '1';
elsif iphase = 1 then
result.reg_we := '1';
end if;
when "CALL|K " => -- call
if iphase = 0 then
result.pc_load := '1';
result.stk_push := '1';
end if;
when "RET " => -- return
if iphase = 0 then
result.pc_load := '1';
result.stk_pop := '1';
end if;
when "RETI " => -- return
result.pc_inc := '0';
result.int_exit := '1';
when others => null; -- nop
end case;
return result;
end idecoder;
function gen_murom return murom_t is
variable result : murom_t;
variable opcode : opcode_t;
variable iphase : iphase_t;
variable addr : unsigned(MUCODE_ADDR_WIDTH-1 downto 0);
variable status : cpu_status_t;
variable pos : integer := 0;
begin
for i in 0 to 2**addr'length-1 loop
addr := to_unsigned(i, addr'length);
opcode := addr(opcode'length-1 downto 0);
pos := opcode'length;
iphase := 0;
if addr(pos) = '1' then
iphase := 1;
end if;
pos := pos + 1;
status.alu.zero := addr(pos);
pos := pos + 1;
status.alu.carry := addr(pos);
pos := pos + 1;
status.xmem_wait := addr(pos);
result(i) := idecoder(opcode, iphase, status);
end loop;
return result;
end gen_murom;
function get_muromaddr (opcode : opcode_t; iphase : iphase_t; status : cpu_status_t) return unsigned is
variable addr : unsigned(MUCODE_ADDR_WIDTH-1 downto 0);
begin
addr := status.xmem_wait & status.alu.carry & status.alu.zero & to_unsigned(iphase, 1) & opcode;
return addr;
end get_muromaddr;
-------------------------------------------------------------
function MIN (X, Y: INTEGER) return INTEGER is
variable res : integer := X;
begin
if Y < X then
res := Y;
end if;
return res;
end MIN;
-------------------------------------------------------------
function MAX (X, Y: INTEGER) return INTEGER is
variable res : integer := X;
begin
if Y > X then
res := Y;
end if;
return res;
end MAX;
end cpu_pkg;
-87
View File
@@ -1,87 +0,0 @@
--------------------------------------------------------------------------
-- Project: JCPU, a portable 8-bit RISC CPU written in VHDL
-- This file: The datapath controller
--
-- Copyright (C) 2007 J. Ahrensfeld
--
-- This program is free software: you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
-- the Free Software Foundation, either version 3 of the License, or
-- (at your option) any later version.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU General Public License for more details.
--
-- You should have received a copy of the GNU General Public License
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
--
-- For questions and ideas, please contact the author at jens@jayfield.org
--
--------------------------------------------------------------------------
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.numeric_std.ALL;
use work.cpu_pkg.all;
entity dpath_ctrl is
Generic (
use_rom : boolean := true
);
Port (
inst_in : in inst_t;
iphase_in : in iphase_t;
status_in : in cpu_status_t;
ctrl_out : out dpath_ctrl_out_t;
idout : out inst_addr_t;
ddout : out dmem_data_t
);
end dpath_ctrl;
architecture Behavioral of dpath_ctrl is
signal opcode : opcode_t;
signal ctrl_lines : ctrl_lines_t;
signal dbg_iname : instr_name_t;
begin
idout <= inst_in(IMEM_ADDR_WIDTH-1 downto 0);
ddout <= inst_in(REG_SIZE_BITS+DMEM_DATA_WIDTH-1 downto REG_SIZE_BITS);
opcode <= inst_in(IMEM_DATA_WIDTH-1 downto IMEM_DATA_WIDTH-INST_OPCODE_WIDTH);
ctrl_out.reg_a_ptr <= inst_in(reg_ptr_t'length-1 downto 0);
ctrl_out.reg_b_ptr <= inst_in(2*(reg_ptr_t'length)-1 downto reg_ptr_t'length);
ctrl_out.lines <= ctrl_lines;
-- pragma translate_off
dbg_iname <= instr_name_array(to_integer(opcode));
-- pragma translate_on
gen_ctrl_rom:
if use_rom = true generate
i_dec:
process(opcode, iphase_in, status_in)
constant rom_data : murom_t := gen_murom;
variable addr : unsigned(MUCODE_ADDR_WIDTH-1 downto 0);
begin
addr := get_muromaddr(opcode, iphase_in, status_in);
ctrl_lines <= rom_data(to_integer(addr));
end process;
end generate;
gen_ctrl:
if use_rom = false generate
i_dec:
process (opcode, iphase_in, status_in)
begin
ctrl_lines <= idecoder(opcode, iphase_in, status_in);
end process;
end generate;
end Behavioral;
-177
View File
@@ -1,177 +0,0 @@
--------------------------------------------------------------------------
-- Project: JCPU, a portable 8-bit RISC CPU written in VHDL
-- This file: Interrupt controller
--
-- Copyright (C) 2007 J. Ahrensfeld
--
-- This program is free software: you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
-- the Free Software Foundation, either version 3 of the License, or
-- (at your option) any later version.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU General Public License for more details.
--
-- You should have received a copy of the GNU General Public License
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
--
-- For questions and ideas, please contact the author at jens@jayfield.org
--
--------------------------------------------------------------------------
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.numeric_std.ALL;
use work.cpu_pkg.all;
entity int_ctrl is
Port (
rst : in STD_LOGIC;
clk : in STD_LOGIC;
ctrl_in : in int_ctrl_in_t;
int_in : in STD_LOGIC;
int_exit : in STD_LOGIC;
iphase_in : in iphase_t;
pc_addr_out : out inst_addr_t;
int_ack_out : out STD_LOGIC;
stat_save_out : out STD_LOGIC;
stat_rest_out : out STD_LOGIC;
pc_load_out : out STD_LOGIC;
stk_push_out : out STD_LOGIC;
stk_pop_out : out STD_LOGIC
);
end int_ctrl;
architecture Behavioral of int_ctrl is
type int_state_t is (int_idle, int_inject, int_active, int_release);
type pin_state_t is (pin_s0, pin_s1, pin_s2);
signal int_state, int_state_next : int_state_t;
signal pin_state, pin_state_next : pin_state_t;
signal pc_load, int_ack, stk_push, stk_pop : STD_LOGIC;
signal int_request : std_logic;
signal int_sampled : std_logic;
begin
int_ack_out <= int_ack;
pc_load_out <= pc_load;
stk_push_out <= stk_push;
stk_pop_out <= stk_pop;
-----------------------------------------------------------------------
irg_ctrl_fsm:
process (int_state, iphase_in, int_request, int_exit)
begin
pc_addr_out <= to_unsigned(1, inst_addr_t'length);
int_state_next <= int_state;
int_ack <= '0';
pc_load <= '0';
stk_push <= '0';
stk_pop <= '0';
case int_state is
when int_idle =>
if int_request = '1' and iphase_in = 1 then
int_state_next <= int_inject;
end if;
when int_inject =>
if iphase_in = 0 then
int_ack <= '1';
pc_load <= '1';
elsif iphase_in = 1 then
stk_push <= '1';
int_state_next <= int_active;
end if;
when int_active =>
if int_exit = '1' and iphase_in = 1 then
int_state_next <= int_release;
end if;
when int_release =>
if iphase_in = 0 then
stk_pop <= '1';
pc_load <= '1';
elsif iphase_in = 1 then
int_state_next <= int_idle;
end if;
when others =>
int_state_next <= int_idle;
end case;
end process;
irq_ctrl_states:
process (rst, clk, int_state_next)
begin
if rst = '1' then
int_state <= int_idle;
elsif rising_edge(clk) then
int_state <= int_state_next;
end if;
end process;
-----------------------------------------------------------------------
pin_sample:
process (clk)
begin
if rising_edge(clk) then
int_sampled <= int_in xor (not ctrl_in.polarity);
end if;
end process;
-----------------------------------------------------------------------
pin_fsm:
process (pin_state, int_sampled, int_ack, ctrl_in)
begin
int_request <= '0';
pin_state_next <= pin_state;
case pin_state is
when pin_s0 =>
if int_sampled = '1' or ctrl_in.request = '1' then
if ctrl_in.enable = '1' then
pin_state_next <= pin_s1;
end if;
end if;
when pin_s1 =>
int_request <= '1';
if int_ack = '1' then
pin_state_next <= pin_s2;
end if;
when pin_s2 =>
if ctrl_in.edge_sens = '0' then
pin_state_next <= pin_s0;
elsif int_sampled = '0' then
pin_state_next <= pin_s0;
end if;
when others =>
pin_state_next <= pin_s0;
end case;
end process;
pin_states:
process (rst, clk, pin_state_next)
begin
if rst = '1' then
pin_state <= pin_s0;
elsif rising_edge(clk) then
pin_state <= pin_state_next;
end if;
end process;
-----------------------------------------------------------------------
stat_save_restore:
process (clk, stk_push, stk_pop)
begin
if rising_edge(clk) then
stat_save_out <= stk_push;
stat_rest_out <= stk_pop;
end if;
end process;
end Behavioral;
-70
View File
@@ -1,70 +0,0 @@
--------------------------------------------------------------------------
-- Project: JCPU, a portable 8-bit RISC CPU written in VHDL
-- This file: Programm counter
--
-- Copyright (C) 2007 J. Ahrensfeld
--
-- This program is free software: you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
-- the Free Software Foundation, either version 3 of the License, or
-- (at your option) any later version.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU General Public License for more details.
--
-- You should have received a copy of the GNU General Public License
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
--
-- For questions and ideas, please contact the author at jens@jayfield.org
--
--------------------------------------------------------------------------
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.numeric_std.ALL;
use work.cpu_pkg.all;
entity pc is
Port (
rst : in STD_LOGIC;
clk : in STD_LOGIC;
inc : in STD_LOGIC;
load : in STD_LOGIC;
pc_in : in inst_addr_t;
pc_out : out inst_addr_t;
pc_next : out inst_addr_t
);
end pc;
architecture Behavioral of pc is
begin
proc_pc:
process(rst, clk, inc, load, pc_in)
variable vpc, vpc_reg: inst_addr_t;
begin
if rst = '1' then
vpc_reg := (others => '0');
elsif rising_edge(clk) then
if inc = '1' or load = '1' then
vpc_reg := vpc;
elsif inc = '0' then
pc_next <= vpc;
end if;
end if;
if load = '1' then
vpc := pc_in;
else
vpc := vpc_reg + 1;
end if;
pc_out <= vpc_reg;
end process;
end Behavioral;
-81
View File
@@ -1,81 +0,0 @@
--------------------------------------------------------------------------
-- Project: JCPU, a portable 8-bit RISC CPU written in VHDL
-- This file: On-Chip work registers
--
-- Copyright (C) 2007 J. Ahrensfeld
--
-- This program is free software: you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
-- the Free Software Foundation, either version 3 of the License, or
-- (at your option) any later version.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU General Public License for more details.
--
-- You should have received a copy of the GNU General Public License
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
--
-- For questions and ideas, please contact the author at jens@jayfield.org
--
--------------------------------------------------------------------------
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.numeric_std.ALL;
use work.cpu_pkg.all;
entity reg_dual is
Generic (
addr_width : integer := 3;
data_width : integer := 8
);
Port (
clk : in STD_LOGIC;
we_a : in STD_LOGIC;
ptr_a : in reg_ptr_t;
ptr_b : in reg_ptr_t;
din_a : in unsigned (data_width-1 downto 0);
dout_a : out unsigned (data_width-1 downto 0);
dout_b : out unsigned (data_width-1 downto 0)
);
end reg_dual;
architecture Behavioral of reg_dual is
constant depth : integer := 2**addr_width;
type mem_t is array (0 to depth-1) of unsigned (data_width-1 downto 0);
signal addr_a, addr_b : unsigned (addr_width-1 downto 0) := (others => '0');
signal mem : mem_t;
begin
addr_a <= TO_01(ptr_a(addr_width-1 downto 0));
addr_b <= TO_01(ptr_b(addr_width-1 downto 0));
reg_in_ab:
process(clk)
begin
if rising_edge(clk) then
if we_a = '1' then
mem(to_integer(addr_a)) <= din_a;
end if;
end if;
end process;
reg_out_a:
process(mem, addr_a)
begin
dout_a <= TO_01(mem(to_integer(addr_a)));
end process;
reg_out_b:
process(mem, addr_b)
begin
dout_b <= TO_01(mem(to_integer(addr_b)));
end process;
end Behavioral;
-73
View File
@@ -1,73 +0,0 @@
--------------------------------------------------------------------------
-- Project: JCPU, a portable 8-bit RISC CPU written in VHDL
-- This file: The call/return/data stack
--
-- Copyright (C) 2007 J. Ahrensfeld
--
-- This program is free software: you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
-- the Free Software Foundation, either version 3 of the License, or
-- (at your option) any later version.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU General Public License for more details.
--
-- You should have received a copy of the GNU General Public License
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
--
-- For questions and ideas, please contact the author at jens@jayfield.org
--
--------------------------------------------------------------------------
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.numeric_std.ALL;
use work.cpu_pkg.all;
entity stack_ctrl is
Generic (
addr_width : integer := 3
);
Port (
rst : in STD_LOGIC;
clk : in STD_LOGIC;
push : in STD_LOGIC;
pop : in STD_LOGIC;
ptr_out : out unsigned (addr_width-1 downto 0);
din : in inst_addr_t;
dout : out inst_addr_t;
mem_we : out STD_LOGIC
);
end stack_ctrl;
architecture Behavioral of stack_ctrl is
signal ptr : unsigned (addr_width-1 downto 0);
begin
ptr_out <= ptr;
stk_ptr:
process(rst, clk, ptr, push, pop)
begin
if rst = '1' then
ptr <= (others => '0');
dout <= (others => '0');
mem_we <= '0';
elsif rising_edge(clk) then
mem_we <= push;
if push = '1' then
ptr <= ptr + 1;
dout <= din;
elsif pop = '1' then
ptr <= ptr - 1;
end if;
end if;
end process;
end Behavioral;
-109
View File
@@ -1,109 +0,0 @@
-------------------------------------------------------------------------
-- Project: JCPU, a portable 8-bit RISC CPU written in VHDL
-- This file: cpu_embedded using cpu_core and rom
--
-- Copyright (C) 2007 J. Ahrensfeld
--
-- This program is free software: you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
-- the Free Software Foundation, either version 3 of the License, or
-- (at your option) any later version.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU General Public License for more details.
--
-- You should have received a copy of the GNU General Public License
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
--
-- For questions and ideas, please contact the author at jens@jayfield.org
--
--------------------------------------------------------------------------
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.numeric_std.ALL;
use work.cpu_pkg.all;
entity cpu_embedded is
Port (
rst : in STD_LOGIC;
clk : in STD_LOGIC;
ce : in STD_LOGIC;
int_in : in STD_LOGIC;
int_ack : out STD_LOGIC;
xmem_wait : in STD_LOGIC;
xmem_we : out STD_LOGIC;
xmem_re : out STD_LOGIC;
xmem_din : in unsigned (DMEM_DATA_WIDTH-1 downto 0);
xmem_dout : out unsigned (DMEM_DATA_WIDTH-1 downto 0);
xmem_addr : out unsigned (DMEM_ADDR_WIDTH-1 downto 0);
io_sel : out STD_LOGIC
);
end cpu_embedded;
architecture rtl of cpu_embedded is
signal irom_data : unsigned (IMEM_DATA_WIDTH-1 downto 0);
signal irom_addr : unsigned (IMEM_ADDR_WIDTH-1 downto 0);
COMPONENT cpu
Port (
rst : in STD_LOGIC;
clk : in STD_LOGIC;
ce : in STD_LOGIC;
int_in : in STD_LOGIC;
int_ack : out STD_LOGIC;
xmem_wait : in STD_LOGIC;
xmem_we : out STD_LOGIC;
xmem_re : out STD_LOGIC;
instr_din : in unsigned (IMEM_DATA_WIDTH-1 downto 0);
instr_addr : out unsigned (IMEM_ADDR_WIDTH-1 downto 0);
xmem_din : in unsigned (DMEM_DATA_WIDTH-1 downto 0);
xmem_dout : out unsigned (DMEM_DATA_WIDTH-1 downto 0);
xmem_addr : out unsigned (DMEM_DATA_WIDTH-1 downto 0);
io_sel : out STD_LOGIC
);
END COMPONENT;
COMPONENT irom
Port (
clk : in STD_LOGIC;
ce : in STD_LOGIC;
addr : in inst_addr_t;
dout : out inst_t
);
END COMPONENT;
begin
inst_cpu: cpu
PORT MAP(
rst => rst,
clk => clk,
ce => ce,
int_in => int_in,
int_ack => int_ack,
xmem_wait => xmem_wait,
xmem_we => xmem_we,
xmem_re => xmem_re,
instr_din => irom_data,
instr_addr => irom_addr,
xmem_din => xmem_din,
xmem_dout => xmem_dout,
xmem_addr => xmem_addr,
io_sel => io_sel
);
inst_irom: irom
PORT MAP(
clk => clk,
ce => ce,
addr => irom_addr,
dout => irom_data
);
end rtl;
-79
View File
@@ -1,79 +0,0 @@
-------------------------------------------------------------------------
-- Project: JCPU, a portable 8-bit RISC CPU written in VHDL
-- This file: The ROM file for use in your VHDL design
--
-- Copyright (C) 2007 J. Ahrensfeld
--
-- This program is free software: you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
-- the Free Software Foundation, either version 3 of the License, or
-- (at your option) any later version.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU General Public License for more details.
--
-- You should have received a copy of the GNU General Public License
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
--
-- For questions and ideas, please contact the author at jens@jayfield.org
--
--------------------------------------------------------------------------
LIBRARY ieee;
use IEEE.STD_LOGIC_1164.ALL;
USE ieee.numeric_std.ALL;
library work;
use work.cpu_pkg.all;
-- JASM_ROM_INSERT_HERE
ENTITY irom IS
Port (
clk : in STD_LOGIC;
ce : in STD_LOGIC;
addr : in inst_addr_t;
dout : out inst_t
);
END irom;
ARCHITECTURE dctest OF irom IS
type imem_rom_t is array (0 to 17) of inst_t;
-- Assembled from dctest.jsm
constant imem_rom : imem_rom_t :=
(
"110000" & X"010", -- 0x000: JMP 0x010
"110000" & X"011", -- 0x001: JMP 0x011
"000000" & X"000", -- 0x002:
"000000" & X"000", -- 0x003:
"000000" & X"000", -- 0x004:
"000000" & X"000", -- 0x005:
"000000" & X"000", -- 0x006:
"000000" & X"000", -- 0x007:
"000000" & X"000", -- 0x008:
"000000" & X"000", -- 0x009:
"000000" & X"000", -- 0x00A:
"000000" & X"000", -- 0x00B:
"000000" & X"000", -- 0x00C:
"000000" & X"000", -- 0x00D:
"000000" & X"000", -- 0x00E:
"000000" & X"000", -- 0x00F:
"110000" & X"010", -- 0x010: JMP 0x010
"111111" & X"000" -- 0x011: RETI
);
begin
PROM_READ:
process(clk, ce)
begin
if rising_edge(clk) and ce = '1' then
dout <= imem_rom(to_integer(addr));
end if;
end process;
end dctest;
File diff suppressed because it is too large Load Diff
-317
View File
@@ -1,317 +0,0 @@
-------------------------------------------------------------------------
-- Project: JCPU, a portable 8-bit RISC CPU written in VHDL
-- This file: The ROM file for use in your VHDL design
--
-- Copyright (C) 2007 J. Ahrensfeld
--
-- This program is free software: you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
-- the Free Software Foundation, either version 3 of the License, or
-- (at your option) any later version.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU General Public License for more details.
--
-- You should have received a copy of the GNU General Public License
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
--
-- For questions and ideas, please contact the author at jens@jayfield.org
--
--------------------------------------------------------------------------
LIBRARY ieee;
use IEEE.STD_LOGIC_1164.ALL;
USE ieee.numeric_std.ALL;
library work;
use work.cpu_pkg.all;
-- JASM_ROM_INSERT_HERE
ENTITY xrom IS
Port (
clk : in STD_LOGIC;
ce : in STD_LOGIC;
addr : in dmem_addr_t;
dout : out dmem_data_t
);
END xrom;
ARCHITECTURE dctest OF xrom IS
type xmem_rom_t is array (0 to 255) of dmem_data_t;
-- Assembled from dctest.jsm
constant xmem_rom : xmem_rom_t :=
(
X"00", -- 0x00
X"00", -- 0x01
X"00", -- 0x02
X"00", -- 0x03
X"01", -- 0x04
X"12", -- 0x05
X"41", -- 0x06
X"00", -- 0x07
X"00", -- 0x08
X"00", -- 0x09
X"00", -- 0x0A
X"00", -- 0x0B
X"00", -- 0x0C
X"00", -- 0x0D
X"00", -- 0x0E
X"00", -- 0x0F
X"00", -- 0x10
X"00", -- 0x11
X"00", -- 0x12
X"00", -- 0x13
X"00", -- 0x14
X"00", -- 0x15
X"00", -- 0x16
X"48", -- 0x17
X"61", -- 0x18
X"6C", -- 0x19
X"6C", -- 0x1A
X"6F", -- 0x1B
X"0D", -- 0x1C
X"0A", -- 0x1D
X"00", -- 0x1E
X"4A", -- 0x1F
X"65", -- 0x20
X"6E", -- 0x21
X"73", -- 0x22
X"00", -- 0x23
X"57", -- 0x24
X"65", -- 0x25
X"6C", -- 0x26
X"63", -- 0x27
X"6F", -- 0x28
X"6D", -- 0x29
X"65", -- 0x2A
X"20", -- 0x2B
X"74", -- 0x2C
X"6F", -- 0x2D
X"20", -- 0x2E
X"4A", -- 0x2F
X"41", -- 0x30
X"53", -- 0x31
X"4D", -- 0x32
X"20", -- 0x33
X"43", -- 0x34
X"50", -- 0x35
X"55", -- 0x36
X"00", -- 0x37
X"52", -- 0x38
X"65", -- 0x39
X"61", -- 0x3A
X"64", -- 0x3B
X"79", -- 0x3C
X"00", -- 0x3D
X"54", -- 0x3E
X"65", -- 0x3F
X"73", -- 0x40
X"74", -- 0x41
X"69", -- 0x42
X"6E", -- 0x43
X"67", -- 0x44
X"00", -- 0x45
X"50", -- 0x46
X"61", -- 0x47
X"73", -- 0x48
X"73", -- 0x49
X"65", -- 0x4A
X"64", -- 0x4B
X"00", -- 0x4C
X"45", -- 0x4D
X"72", -- 0x4E
X"72", -- 0x4F
X"6F", -- 0x50
X"72", -- 0x51
X"00", -- 0x52
X"0D", -- 0x53
X"0A", -- 0x54
X"00", -- 0x55
X"00", -- 0x56
X"00", -- 0x57
X"00", -- 0x58
X"00", -- 0x59
X"00", -- 0x5A
X"00", -- 0x5B
X"00", -- 0x5C
X"00", -- 0x5D
X"00", -- 0x5E
X"00", -- 0x5F
X"00", -- 0x60
X"00", -- 0x61
X"00", -- 0x62
X"00", -- 0x63
X"00", -- 0x64
X"00", -- 0x65
X"00", -- 0x66
X"00", -- 0x67
X"00", -- 0x68
X"00", -- 0x69
X"00", -- 0x6A
X"00", -- 0x6B
X"00", -- 0x6C
X"00", -- 0x6D
X"00", -- 0x6E
X"00", -- 0x6F
X"00", -- 0x70
X"00", -- 0x71
X"00", -- 0x72
X"00", -- 0x73
X"00", -- 0x74
X"00", -- 0x75
X"00", -- 0x76
X"00", -- 0x77
X"00", -- 0x78
X"00", -- 0x79
X"00", -- 0x7A
X"00", -- 0x7B
X"00", -- 0x7C
X"00", -- 0x7D
X"00", -- 0x7E
X"00", -- 0x7F
X"00", -- 0x80
X"00", -- 0x81
X"00", -- 0x82
X"00", -- 0x83
X"00", -- 0x84
X"00", -- 0x85
X"00", -- 0x86
X"00", -- 0x87
X"00", -- 0x88
X"00", -- 0x89
X"00", -- 0x8A
X"00", -- 0x8B
X"00", -- 0x8C
X"00", -- 0x8D
X"00", -- 0x8E
X"00", -- 0x8F
X"00", -- 0x90
X"00", -- 0x91
X"00", -- 0x92
X"00", -- 0x93
X"00", -- 0x94
X"00", -- 0x95
X"00", -- 0x96
X"00", -- 0x97
X"00", -- 0x98
X"00", -- 0x99
X"00", -- 0x9A
X"00", -- 0x9B
X"00", -- 0x9C
X"00", -- 0x9D
X"00", -- 0x9E
X"00", -- 0x9F
X"00", -- 0xA0
X"00", -- 0xA1
X"00", -- 0xA2
X"00", -- 0xA3
X"00", -- 0xA4
X"00", -- 0xA5
X"00", -- 0xA6
X"00", -- 0xA7
X"00", -- 0xA8
X"00", -- 0xA9
X"00", -- 0xAA
X"00", -- 0xAB
X"00", -- 0xAC
X"00", -- 0xAD
X"00", -- 0xAE
X"00", -- 0xAF
X"00", -- 0xB0
X"00", -- 0xB1
X"00", -- 0xB2
X"00", -- 0xB3
X"00", -- 0xB4
X"00", -- 0xB5
X"00", -- 0xB6
X"00", -- 0xB7
X"00", -- 0xB8
X"00", -- 0xB9
X"00", -- 0xBA
X"00", -- 0xBB
X"00", -- 0xBC
X"00", -- 0xBD
X"00", -- 0xBE
X"00", -- 0xBF
X"00", -- 0xC0
X"00", -- 0xC1
X"00", -- 0xC2
X"00", -- 0xC3
X"00", -- 0xC4
X"00", -- 0xC5
X"00", -- 0xC6
X"00", -- 0xC7
X"00", -- 0xC8
X"00", -- 0xC9
X"00", -- 0xCA
X"00", -- 0xCB
X"00", -- 0xCC
X"00", -- 0xCD
X"00", -- 0xCE
X"00", -- 0xCF
X"00", -- 0xD0
X"00", -- 0xD1
X"00", -- 0xD2
X"00", -- 0xD3
X"00", -- 0xD4
X"00", -- 0xD5
X"00", -- 0xD6
X"00", -- 0xD7
X"00", -- 0xD8
X"00", -- 0xD9
X"00", -- 0xDA
X"00", -- 0xDB
X"00", -- 0xDC
X"00", -- 0xDD
X"00", -- 0xDE
X"00", -- 0xDF
X"00", -- 0xE0
X"00", -- 0xE1
X"00", -- 0xE2
X"00", -- 0xE3
X"00", -- 0xE4
X"00", -- 0xE5
X"00", -- 0xE6
X"00", -- 0xE7
X"00", -- 0xE8
X"00", -- 0xE9
X"00", -- 0xEA
X"00", -- 0xEB
X"00", -- 0xEC
X"00", -- 0xED
X"00", -- 0xEE
X"00", -- 0xEF
X"00", -- 0xF0
X"00", -- 0xF1
X"00", -- 0xF2
X"00", -- 0xF3
X"00", -- 0xF4
X"00", -- 0xF5
X"00", -- 0xF6
X"00", -- 0xF7
X"00", -- 0xF8
X"00", -- 0xF9
X"00", -- 0xFA
X"00", -- 0xFB
X"00", -- 0xFC
X"00", -- 0xFD
X"00", -- 0xFE
X"00" -- 0xFF
);
begin
PROM_READ:
process(clk, ce)
begin
if rising_edge(clk) and ce = '1' then
dout <= xmem_rom(to_integer(addr));
end if;
end process;
end dctest;
-413
View File
@@ -1,413 +0,0 @@
-------------------------------------------------------------------------
-- Project: JCPU, a portable 8-bit RISC CPU written in VHDL
-- This file: loadable ROM
--
-- Copyright (C) 2007 J. Ahrensfeld
--
-- This program is free software: you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
-- the Free Software Foundation, either version 3 of the License, or
-- (at your option) any later version.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU General Public License for more details.
--
-- You should have received a copy of the GNU General Public License
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
--
-- For questions and ideas, please contact the author at jens@jayfield.org
--
--------------------------------------------------------------------------
LIBRARY ieee;
use IEEE.STD_LOGIC_1164.ALL;
USE ieee.numeric_std.ALL;
library UNISIM;
use UNISIM.VComponents.all;
library work;
use work.cpu_pkg.all;
ENTITY xrom IS
Port (
clk : in STD_LOGIC;
ce : in STD_LOGIC;
addr : in dmem_addr_t;
dout : out dmem_data_t
);
END xrom;
ARCHITECTURE loadable OF xrom IS
-- JASM_ROM_INSERT_HERE
-- Assembled from dctest.jsm
type xmem_rom_t is array (0 to 255) of dmem_data_t;
signal xmem_rom : xmem_rom_t :=
(
X"00", -- 0x00
X"00", -- 0x01
X"00", -- 0x02
X"00", -- 0x03
X"01", -- 0x04
X"12", -- 0x05
X"41", -- 0x06
X"00", -- 0x07
X"00", -- 0x08
X"00", -- 0x09
X"00", -- 0x0A
X"00", -- 0x0B
X"00", -- 0x0C
X"00", -- 0x0D
X"00", -- 0x0E
X"00", -- 0x0F
X"00", -- 0x10
X"00", -- 0x11
X"00", -- 0x12
X"00", -- 0x13
X"00", -- 0x14
X"00", -- 0x15
X"00", -- 0x16
X"48", -- 0x17
X"61", -- 0x18
X"6C", -- 0x19
X"6C", -- 0x1A
X"6F", -- 0x1B
X"0D", -- 0x1C
X"0A", -- 0x1D
X"00", -- 0x1E
X"4A", -- 0x1F
X"65", -- 0x20
X"6E", -- 0x21
X"73", -- 0x22
X"00", -- 0x23
X"57", -- 0x24
X"65", -- 0x25
X"6C", -- 0x26
X"63", -- 0x27
X"6F", -- 0x28
X"6D", -- 0x29
X"65", -- 0x2A
X"20", -- 0x2B
X"74", -- 0x2C
X"6F", -- 0x2D
X"20", -- 0x2E
X"4A", -- 0x2F
X"41", -- 0x30
X"53", -- 0x31
X"4D", -- 0x32
X"20", -- 0x33
X"43", -- 0x34
X"50", -- 0x35
X"55", -- 0x36
X"00", -- 0x37
X"52", -- 0x38
X"65", -- 0x39
X"61", -- 0x3A
X"64", -- 0x3B
X"79", -- 0x3C
X"00", -- 0x3D
X"54", -- 0x3E
X"65", -- 0x3F
X"73", -- 0x40
X"74", -- 0x41
X"69", -- 0x42
X"6E", -- 0x43
X"67", -- 0x44
X"00", -- 0x45
X"50", -- 0x46
X"61", -- 0x47
X"73", -- 0x48
X"73", -- 0x49
X"65", -- 0x4A
X"64", -- 0x4B
X"00", -- 0x4C
X"45", -- 0x4D
X"72", -- 0x4E
X"72", -- 0x4F
X"6F", -- 0x50
X"72", -- 0x51
X"00", -- 0x52
X"0D", -- 0x53
X"0A", -- 0x54
X"00", -- 0x55
X"00", -- 0x56
X"00", -- 0x57
X"00", -- 0x58
X"00", -- 0x59
X"00", -- 0x5A
X"00", -- 0x5B
X"00", -- 0x5C
X"00", -- 0x5D
X"00", -- 0x5E
X"00", -- 0x5F
X"00", -- 0x60
X"00", -- 0x61
X"00", -- 0x62
X"00", -- 0x63
X"00", -- 0x64
X"00", -- 0x65
X"00", -- 0x66
X"00", -- 0x67
X"00", -- 0x68
X"00", -- 0x69
X"00", -- 0x6A
X"00", -- 0x6B
X"00", -- 0x6C
X"00", -- 0x6D
X"00", -- 0x6E
X"00", -- 0x6F
X"00", -- 0x70
X"00", -- 0x71
X"00", -- 0x72
X"00", -- 0x73
X"00", -- 0x74
X"00", -- 0x75
X"00", -- 0x76
X"00", -- 0x77
X"00", -- 0x78
X"00", -- 0x79
X"00", -- 0x7A
X"00", -- 0x7B
X"00", -- 0x7C
X"00", -- 0x7D
X"00", -- 0x7E
X"00", -- 0x7F
X"00", -- 0x80
X"00", -- 0x81
X"00", -- 0x82
X"00", -- 0x83
X"00", -- 0x84
X"00", -- 0x85
X"00", -- 0x86
X"00", -- 0x87
X"00", -- 0x88
X"00", -- 0x89
X"00", -- 0x8A
X"00", -- 0x8B
X"00", -- 0x8C
X"00", -- 0x8D
X"00", -- 0x8E
X"00", -- 0x8F
X"00", -- 0x90
X"00", -- 0x91
X"00", -- 0x92
X"00", -- 0x93
X"00", -- 0x94
X"00", -- 0x95
X"00", -- 0x96
X"00", -- 0x97
X"00", -- 0x98
X"00", -- 0x99
X"00", -- 0x9A
X"00", -- 0x9B
X"00", -- 0x9C
X"00", -- 0x9D
X"00", -- 0x9E
X"00", -- 0x9F
X"00", -- 0xA0
X"00", -- 0xA1
X"00", -- 0xA2
X"00", -- 0xA3
X"00", -- 0xA4
X"00", -- 0xA5
X"00", -- 0xA6
X"00", -- 0xA7
X"00", -- 0xA8
X"00", -- 0xA9
X"00", -- 0xAA
X"00", -- 0xAB
X"00", -- 0xAC
X"00", -- 0xAD
X"00", -- 0xAE
X"00", -- 0xAF
X"00", -- 0xB0
X"00", -- 0xB1
X"00", -- 0xB2
X"00", -- 0xB3
X"00", -- 0xB4
X"00", -- 0xB5
X"00", -- 0xB6
X"00", -- 0xB7
X"00", -- 0xB8
X"00", -- 0xB9
X"00", -- 0xBA
X"00", -- 0xBB
X"00", -- 0xBC
X"00", -- 0xBD
X"00", -- 0xBE
X"00", -- 0xBF
X"00", -- 0xC0
X"00", -- 0xC1
X"00", -- 0xC2
X"00", -- 0xC3
X"00", -- 0xC4
X"00", -- 0xC5
X"00", -- 0xC6
X"00", -- 0xC7
X"00", -- 0xC8
X"00", -- 0xC9
X"00", -- 0xCA
X"00", -- 0xCB
X"00", -- 0xCC
X"00", -- 0xCD
X"00", -- 0xCE
X"00", -- 0xCF
X"00", -- 0xD0
X"00", -- 0xD1
X"00", -- 0xD2
X"00", -- 0xD3
X"00", -- 0xD4
X"00", -- 0xD5
X"00", -- 0xD6
X"00", -- 0xD7
X"00", -- 0xD8
X"00", -- 0xD9
X"00", -- 0xDA
X"00", -- 0xDB
X"00", -- 0xDC
X"00", -- 0xDD
X"00", -- 0xDE
X"00", -- 0xDF
X"00", -- 0xE0
X"00", -- 0xE1
X"00", -- 0xE2
X"00", -- 0xE3
X"00", -- 0xE4
X"00", -- 0xE5
X"00", -- 0xE6
X"00", -- 0xE7
X"00", -- 0xE8
X"00", -- 0xE9
X"00", -- 0xEA
X"00", -- 0xEB
X"00", -- 0xEC
X"00", -- 0xED
X"00", -- 0xEE
X"00", -- 0xEF
X"00", -- 0xF0
X"00", -- 0xF1
X"00", -- 0xF2
X"00", -- 0xF3
X"00", -- 0xF4
X"00", -- 0xF5
X"00", -- 0xF6
X"00", -- 0xF7
X"00", -- 0xF8
X"00", -- 0xF9
X"00", -- 0xFA
X"00", -- 0xFB
X"00", -- 0xFC
X"00", -- 0xFD
X"00", -- 0xFE
X"00" -- 0xFF
);
signal jtag_ld_clk : STD_LOGIC;
signal jtag_ld_we : STD_LOGIC;
signal jtag_ld_addr : dmem_addr_t;
signal jtag_ld_dout : dmem_data_t;
signal jtag_ld_din : dmem_data_t;
signal bs_rst, bs_sel, bs_shift, bs_tdi, bs_tdo : std_logic;
signal bs_capture, bs_clk0, bs_clk1, bs_update0, bs_update1 : std_logic;
signal user_regi, user_rego : unsigned (15 downto 0);
constant id : unsigned (15 downto 0) := X"BEEF";
begin
--------------------------------------------------------------------------
-- Virtex-4: JTAG Loader
--------------------------------------------------------------------------
i00_BUFG : BUFG
port map
(
O => bs_clk1,
I => bs_clk0
);
i01_BUFG : BUFG
port map
(
O => bs_update1,
I => bs_update0
);
BSCAN_VIRTEX4_inst2 : BSCAN_VIRTEX4
generic map
(
JTAG_CHAIN => 2 -- Value to set BSCAN site of device. Possible values: (1,2,3 or 4)
)
port map
(
CAPTURE => bs_capture, -- CAPTURE output from TAP controller
DRCK => bs_clk0, -- Data register output for USER functions
RESET => bs_rst, -- Reset output from TAP controller
SEL => bs_sel, -- USER active output
SHIFT => bs_shift, -- SHIFT output from TAP controller
TDI => bs_tdi, -- TDI output from TAP controller
UPDATE => bs_update0, -- UPDATE output from TAP controller
TDO => bs_tdo -- Data input for USER function
);
jtag_ld_addr <= user_regi(user_regi'left downto user_regi'left-dmem_data_t'length+1);
jtag_ld_din <= user_regi(dmem_data_t'left downto 0);
jtag_ld_clk <= bs_update1;
jtag_ld_we <= bs_sel;
sipo:
process (bs_rst, bs_clk1, bs_tdi, bs_shift)
begin
if bs_rst = '1' then
user_regi <= (others => '0');
elsif rising_edge(bs_clk1) then
if bs_shift = '1' then
user_regi <= bs_tdi & user_regi(user_regi'left downto 1);
end if;
end if;
end process;
piso:
process (bs_rst, bs_clk1, bs_shift, user_rego)
begin
bs_tdo <= user_rego(0);
if bs_rst = '1' then
user_rego <= (others => '0');
elsif rising_edge(bs_clk1) then
if bs_shift = '1' then
user_rego <= user_rego(0) & user_rego(user_rego'left downto 1);
else
user_rego <= (user_rego'left downto dmem_data_t'length => '0') & jtag_ld_dout;
-- user_rego <= id;
end if;
end if;
end process;
--------------------------------------------------------------------------
-- ROM Read/Write
--------------------------------------------------------------------------
PROM_READ:
process(clk, ce)
begin
if rising_edge(clk) and ce = '1' then
dout <= xmem_rom(to_integer(addr));
end if;
end process;
PROM_WRITE:
process(jtag_ld_clk, jtag_ld_we)
begin
if rising_edge(jtag_ld_clk) then
if jtag_ld_we = '1' then
xmem_rom(to_integer(jtag_ld_addr)) <= jtag_ld_din;
else
jtag_ld_dout <= xmem_rom(to_integer(jtag_ld_addr));
end if;
end if;
end process;
--------------------------------------------------------------------------
end loadable;
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
-317
View File
@@ -1,317 +0,0 @@
-------------------------------------------------------------------------
-- Project: JCPU, a portable 8-bit RISC CPU written in VHDL
-- This file: The ROM file for use in your VHDL design
--
-- Copyright (C) 2007 J. Ahrensfeld
--
-- This program is free software: you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
-- the Free Software Foundation, either version 3 of the License, or
-- (at your option) any later version.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU General Public License for more details.
--
-- You should have received a copy of the GNU General Public License
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
--
-- For questions and ideas, please contact the author at jens@jayfield.org
--
--------------------------------------------------------------------------
LIBRARY ieee;
use IEEE.STD_LOGIC_1164.ALL;
USE ieee.numeric_std.ALL;
library work;
use work.cpu_pkg.all;
-- JASM_ROM_INSERT_HERE
ENTITY xrom IS
Port (
clk : in STD_LOGIC;
ce : in STD_LOGIC;
addr : in dmem_addr_t;
dout : out dmem_data_t
);
END xrom;
ARCHITECTURE itest OF xrom IS
type xmem_rom_t is array (0 to 255) of dmem_data_t;
-- Assembled from itest.jsm
constant xmem_rom : xmem_rom_t :=
(
X"48", -- 0x00
X"61", -- 0x01
X"6C", -- 0x02
X"6C", -- 0x03
X"6F", -- 0x04
X"00", -- 0x05
X"00", -- 0x06
X"00", -- 0x07
X"00", -- 0x08
X"00", -- 0x09
X"00", -- 0x0A
X"00", -- 0x0B
X"00", -- 0x0C
X"00", -- 0x0D
X"00", -- 0x0E
X"00", -- 0x0F
X"00", -- 0x10
X"00", -- 0x11
X"00", -- 0x12
X"00", -- 0x13
X"00", -- 0x14
X"00", -- 0x15
X"00", -- 0x16
X"00", -- 0x17
X"00", -- 0x18
X"00", -- 0x19
X"00", -- 0x1A
X"00", -- 0x1B
X"00", -- 0x1C
X"00", -- 0x1D
X"00", -- 0x1E
X"00", -- 0x1F
X"00", -- 0x20
X"00", -- 0x21
X"00", -- 0x22
X"00", -- 0x23
X"00", -- 0x24
X"00", -- 0x25
X"00", -- 0x26
X"00", -- 0x27
X"00", -- 0x28
X"00", -- 0x29
X"00", -- 0x2A
X"00", -- 0x2B
X"00", -- 0x2C
X"00", -- 0x2D
X"00", -- 0x2E
X"00", -- 0x2F
X"00", -- 0x30
X"00", -- 0x31
X"00", -- 0x32
X"00", -- 0x33
X"00", -- 0x34
X"00", -- 0x35
X"00", -- 0x36
X"00", -- 0x37
X"00", -- 0x38
X"00", -- 0x39
X"00", -- 0x3A
X"00", -- 0x3B
X"00", -- 0x3C
X"00", -- 0x3D
X"00", -- 0x3E
X"00", -- 0x3F
X"00", -- 0x40
X"00", -- 0x41
X"00", -- 0x42
X"00", -- 0x43
X"00", -- 0x44
X"00", -- 0x45
X"00", -- 0x46
X"00", -- 0x47
X"00", -- 0x48
X"00", -- 0x49
X"00", -- 0x4A
X"00", -- 0x4B
X"00", -- 0x4C
X"00", -- 0x4D
X"00", -- 0x4E
X"00", -- 0x4F
X"00", -- 0x50
X"00", -- 0x51
X"00", -- 0x52
X"00", -- 0x53
X"00", -- 0x54
X"00", -- 0x55
X"00", -- 0x56
X"00", -- 0x57
X"00", -- 0x58
X"00", -- 0x59
X"00", -- 0x5A
X"00", -- 0x5B
X"00", -- 0x5C
X"00", -- 0x5D
X"00", -- 0x5E
X"00", -- 0x5F
X"00", -- 0x60
X"00", -- 0x61
X"00", -- 0x62
X"00", -- 0x63
X"00", -- 0x64
X"00", -- 0x65
X"00", -- 0x66
X"00", -- 0x67
X"00", -- 0x68
X"00", -- 0x69
X"00", -- 0x6A
X"00", -- 0x6B
X"00", -- 0x6C
X"00", -- 0x6D
X"00", -- 0x6E
X"00", -- 0x6F
X"00", -- 0x70
X"00", -- 0x71
X"00", -- 0x72
X"00", -- 0x73
X"00", -- 0x74
X"00", -- 0x75
X"00", -- 0x76
X"00", -- 0x77
X"00", -- 0x78
X"00", -- 0x79
X"00", -- 0x7A
X"00", -- 0x7B
X"00", -- 0x7C
X"00", -- 0x7D
X"00", -- 0x7E
X"00", -- 0x7F
X"00", -- 0x80
X"00", -- 0x81
X"00", -- 0x82
X"00", -- 0x83
X"00", -- 0x84
X"00", -- 0x85
X"00", -- 0x86
X"00", -- 0x87
X"00", -- 0x88
X"00", -- 0x89
X"00", -- 0x8A
X"00", -- 0x8B
X"00", -- 0x8C
X"00", -- 0x8D
X"00", -- 0x8E
X"00", -- 0x8F
X"00", -- 0x90
X"00", -- 0x91
X"00", -- 0x92
X"00", -- 0x93
X"00", -- 0x94
X"00", -- 0x95
X"00", -- 0x96
X"00", -- 0x97
X"00", -- 0x98
X"00", -- 0x99
X"00", -- 0x9A
X"00", -- 0x9B
X"00", -- 0x9C
X"00", -- 0x9D
X"00", -- 0x9E
X"00", -- 0x9F
X"00", -- 0xA0
X"00", -- 0xA1
X"00", -- 0xA2
X"00", -- 0xA3
X"00", -- 0xA4
X"00", -- 0xA5
X"00", -- 0xA6
X"00", -- 0xA7
X"00", -- 0xA8
X"00", -- 0xA9
X"00", -- 0xAA
X"00", -- 0xAB
X"00", -- 0xAC
X"00", -- 0xAD
X"00", -- 0xAE
X"00", -- 0xAF
X"00", -- 0xB0
X"00", -- 0xB1
X"00", -- 0xB2
X"00", -- 0xB3
X"00", -- 0xB4
X"00", -- 0xB5
X"00", -- 0xB6
X"00", -- 0xB7
X"00", -- 0xB8
X"00", -- 0xB9
X"00", -- 0xBA
X"00", -- 0xBB
X"00", -- 0xBC
X"00", -- 0xBD
X"00", -- 0xBE
X"00", -- 0xBF
X"00", -- 0xC0
X"00", -- 0xC1
X"00", -- 0xC2
X"00", -- 0xC3
X"00", -- 0xC4
X"00", -- 0xC5
X"00", -- 0xC6
X"00", -- 0xC7
X"00", -- 0xC8
X"00", -- 0xC9
X"00", -- 0xCA
X"00", -- 0xCB
X"00", -- 0xCC
X"00", -- 0xCD
X"00", -- 0xCE
X"00", -- 0xCF
X"00", -- 0xD0
X"00", -- 0xD1
X"00", -- 0xD2
X"00", -- 0xD3
X"00", -- 0xD4
X"00", -- 0xD5
X"00", -- 0xD6
X"00", -- 0xD7
X"00", -- 0xD8
X"00", -- 0xD9
X"00", -- 0xDA
X"00", -- 0xDB
X"00", -- 0xDC
X"00", -- 0xDD
X"00", -- 0xDE
X"00", -- 0xDF
X"00", -- 0xE0
X"00", -- 0xE1
X"00", -- 0xE2
X"00", -- 0xE3
X"00", -- 0xE4
X"00", -- 0xE5
X"00", -- 0xE6
X"00", -- 0xE7
X"00", -- 0xE8
X"00", -- 0xE9
X"00", -- 0xEA
X"00", -- 0xEB
X"00", -- 0xEC
X"00", -- 0xED
X"00", -- 0xEE
X"00", -- 0xEF
X"00", -- 0xF0
X"00", -- 0xF1
X"00", -- 0xF2
X"00", -- 0xF3
X"00", -- 0xF4
X"00", -- 0xF5
X"00", -- 0xF6
X"00", -- 0xF7
X"00", -- 0xF8
X"00", -- 0xF9
X"00", -- 0xFA
X"00", -- 0xFB
X"00", -- 0xFC
X"00", -- 0xFD
X"00", -- 0xFE
X"00" -- 0xFF
);
begin
PROM_READ:
process(clk, ce)
begin
if rising_edge(clk) and ce = '1' then
dout <= xmem_rom(to_integer(addr));
end if;
end process;
end itest;
-413
View File
@@ -1,413 +0,0 @@
-------------------------------------------------------------------------
-- Project: JCPU, a portable 8-bit RISC CPU written in VHDL
-- This file: loadable ROM
--
-- Copyright (C) 2007 J. Ahrensfeld
--
-- This program is free software: you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
-- the Free Software Foundation, either version 3 of the License, or
-- (at your option) any later version.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU General Public License for more details.
--
-- You should have received a copy of the GNU General Public License
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
--
-- For questions and ideas, please contact the author at jens@jayfield.org
--
--------------------------------------------------------------------------
LIBRARY ieee;
use IEEE.STD_LOGIC_1164.ALL;
USE ieee.numeric_std.ALL;
library UNISIM;
use UNISIM.VComponents.all;
library work;
use work.cpu_pkg.all;
ENTITY xrom IS
Port (
clk : in STD_LOGIC;
ce : in STD_LOGIC;
addr : in dmem_addr_t;
dout : out dmem_data_t
);
END xrom;
ARCHITECTURE loadable OF xrom IS
-- JASM_ROM_INSERT_HERE
-- Assembled from itest.jsm
type xmem_rom_t is array (0 to 255) of dmem_data_t;
signal xmem_rom : xmem_rom_t :=
(
X"48", -- 0x00
X"61", -- 0x01
X"6C", -- 0x02
X"6C", -- 0x03
X"6F", -- 0x04
X"00", -- 0x05
X"00", -- 0x06
X"00", -- 0x07
X"00", -- 0x08
X"00", -- 0x09
X"00", -- 0x0A
X"00", -- 0x0B
X"00", -- 0x0C
X"00", -- 0x0D
X"00", -- 0x0E
X"00", -- 0x0F
X"00", -- 0x10
X"00", -- 0x11
X"00", -- 0x12
X"00", -- 0x13
X"00", -- 0x14
X"00", -- 0x15
X"00", -- 0x16
X"00", -- 0x17
X"00", -- 0x18
X"00", -- 0x19
X"00", -- 0x1A
X"00", -- 0x1B
X"00", -- 0x1C
X"00", -- 0x1D
X"00", -- 0x1E
X"00", -- 0x1F
X"00", -- 0x20
X"00", -- 0x21
X"00", -- 0x22
X"00", -- 0x23
X"00", -- 0x24
X"00", -- 0x25
X"00", -- 0x26
X"00", -- 0x27
X"00", -- 0x28
X"00", -- 0x29
X"00", -- 0x2A
X"00", -- 0x2B
X"00", -- 0x2C
X"00", -- 0x2D
X"00", -- 0x2E
X"00", -- 0x2F
X"00", -- 0x30
X"00", -- 0x31
X"00", -- 0x32
X"00", -- 0x33
X"00", -- 0x34
X"00", -- 0x35
X"00", -- 0x36
X"00", -- 0x37
X"00", -- 0x38
X"00", -- 0x39
X"00", -- 0x3A
X"00", -- 0x3B
X"00", -- 0x3C
X"00", -- 0x3D
X"00", -- 0x3E
X"00", -- 0x3F
X"00", -- 0x40
X"00", -- 0x41
X"00", -- 0x42
X"00", -- 0x43
X"00", -- 0x44
X"00", -- 0x45
X"00", -- 0x46
X"00", -- 0x47
X"00", -- 0x48
X"00", -- 0x49
X"00", -- 0x4A
X"00", -- 0x4B
X"00", -- 0x4C
X"00", -- 0x4D
X"00", -- 0x4E
X"00", -- 0x4F
X"00", -- 0x50
X"00", -- 0x51
X"00", -- 0x52
X"00", -- 0x53
X"00", -- 0x54
X"00", -- 0x55
X"00", -- 0x56
X"00", -- 0x57
X"00", -- 0x58
X"00", -- 0x59
X"00", -- 0x5A
X"00", -- 0x5B
X"00", -- 0x5C
X"00", -- 0x5D
X"00", -- 0x5E
X"00", -- 0x5F
X"00", -- 0x60
X"00", -- 0x61
X"00", -- 0x62
X"00", -- 0x63
X"00", -- 0x64
X"00", -- 0x65
X"00", -- 0x66
X"00", -- 0x67
X"00", -- 0x68
X"00", -- 0x69
X"00", -- 0x6A
X"00", -- 0x6B
X"00", -- 0x6C
X"00", -- 0x6D
X"00", -- 0x6E
X"00", -- 0x6F
X"00", -- 0x70
X"00", -- 0x71
X"00", -- 0x72
X"00", -- 0x73
X"00", -- 0x74
X"00", -- 0x75
X"00", -- 0x76
X"00", -- 0x77
X"00", -- 0x78
X"00", -- 0x79
X"00", -- 0x7A
X"00", -- 0x7B
X"00", -- 0x7C
X"00", -- 0x7D
X"00", -- 0x7E
X"00", -- 0x7F
X"00", -- 0x80
X"00", -- 0x81
X"00", -- 0x82
X"00", -- 0x83
X"00", -- 0x84
X"00", -- 0x85
X"00", -- 0x86
X"00", -- 0x87
X"00", -- 0x88
X"00", -- 0x89
X"00", -- 0x8A
X"00", -- 0x8B
X"00", -- 0x8C
X"00", -- 0x8D
X"00", -- 0x8E
X"00", -- 0x8F
X"00", -- 0x90
X"00", -- 0x91
X"00", -- 0x92
X"00", -- 0x93
X"00", -- 0x94
X"00", -- 0x95
X"00", -- 0x96
X"00", -- 0x97
X"00", -- 0x98
X"00", -- 0x99
X"00", -- 0x9A
X"00", -- 0x9B
X"00", -- 0x9C
X"00", -- 0x9D
X"00", -- 0x9E
X"00", -- 0x9F
X"00", -- 0xA0
X"00", -- 0xA1
X"00", -- 0xA2
X"00", -- 0xA3
X"00", -- 0xA4
X"00", -- 0xA5
X"00", -- 0xA6
X"00", -- 0xA7
X"00", -- 0xA8
X"00", -- 0xA9
X"00", -- 0xAA
X"00", -- 0xAB
X"00", -- 0xAC
X"00", -- 0xAD
X"00", -- 0xAE
X"00", -- 0xAF
X"00", -- 0xB0
X"00", -- 0xB1
X"00", -- 0xB2
X"00", -- 0xB3
X"00", -- 0xB4
X"00", -- 0xB5
X"00", -- 0xB6
X"00", -- 0xB7
X"00", -- 0xB8
X"00", -- 0xB9
X"00", -- 0xBA
X"00", -- 0xBB
X"00", -- 0xBC
X"00", -- 0xBD
X"00", -- 0xBE
X"00", -- 0xBF
X"00", -- 0xC0
X"00", -- 0xC1
X"00", -- 0xC2
X"00", -- 0xC3
X"00", -- 0xC4
X"00", -- 0xC5
X"00", -- 0xC6
X"00", -- 0xC7
X"00", -- 0xC8
X"00", -- 0xC9
X"00", -- 0xCA
X"00", -- 0xCB
X"00", -- 0xCC
X"00", -- 0xCD
X"00", -- 0xCE
X"00", -- 0xCF
X"00", -- 0xD0
X"00", -- 0xD1
X"00", -- 0xD2
X"00", -- 0xD3
X"00", -- 0xD4
X"00", -- 0xD5
X"00", -- 0xD6
X"00", -- 0xD7
X"00", -- 0xD8
X"00", -- 0xD9
X"00", -- 0xDA
X"00", -- 0xDB
X"00", -- 0xDC
X"00", -- 0xDD
X"00", -- 0xDE
X"00", -- 0xDF
X"00", -- 0xE0
X"00", -- 0xE1
X"00", -- 0xE2
X"00", -- 0xE3
X"00", -- 0xE4
X"00", -- 0xE5
X"00", -- 0xE6
X"00", -- 0xE7
X"00", -- 0xE8
X"00", -- 0xE9
X"00", -- 0xEA
X"00", -- 0xEB
X"00", -- 0xEC
X"00", -- 0xED
X"00", -- 0xEE
X"00", -- 0xEF
X"00", -- 0xF0
X"00", -- 0xF1
X"00", -- 0xF2
X"00", -- 0xF3
X"00", -- 0xF4
X"00", -- 0xF5
X"00", -- 0xF6
X"00", -- 0xF7
X"00", -- 0xF8
X"00", -- 0xF9
X"00", -- 0xFA
X"00", -- 0xFB
X"00", -- 0xFC
X"00", -- 0xFD
X"00", -- 0xFE
X"00" -- 0xFF
);
signal jtag_ld_clk : STD_LOGIC;
signal jtag_ld_we : STD_LOGIC;
signal jtag_ld_addr : dmem_addr_t;
signal jtag_ld_dout : dmem_data_t;
signal jtag_ld_din : dmem_data_t;
signal bs_rst, bs_sel, bs_shift, bs_tdi, bs_tdo : std_logic;
signal bs_capture, bs_clk0, bs_clk1, bs_update0, bs_update1 : std_logic;
signal user_regi, user_rego : unsigned (15 downto 0);
constant id : unsigned (15 downto 0) := X"BEEF";
begin
--------------------------------------------------------------------------
-- Virtex-4: JTAG Loader
--------------------------------------------------------------------------
i00_BUFG : BUFG
port map
(
O => bs_clk1,
I => bs_clk0
);
i01_BUFG : BUFG
port map
(
O => bs_update1,
I => bs_update0
);
BSCAN_VIRTEX4_inst2 : BSCAN_VIRTEX4
generic map
(
JTAG_CHAIN => 2 -- Value to set BSCAN site of device. Possible values: (1,2,3 or 4)
)
port map
(
CAPTURE => bs_capture, -- CAPTURE output from TAP controller
DRCK => bs_clk0, -- Data register output for USER functions
RESET => bs_rst, -- Reset output from TAP controller
SEL => bs_sel, -- USER active output
SHIFT => bs_shift, -- SHIFT output from TAP controller
TDI => bs_tdi, -- TDI output from TAP controller
UPDATE => bs_update0, -- UPDATE output from TAP controller
TDO => bs_tdo -- Data input for USER function
);
jtag_ld_addr <= user_regi(user_regi'left downto user_regi'left-dmem_data_t'length+1);
jtag_ld_din <= user_regi(dmem_data_t'left downto 0);
jtag_ld_clk <= bs_update1;
jtag_ld_we <= bs_sel;
sipo:
process (bs_rst, bs_clk1, bs_tdi, bs_shift)
begin
if bs_rst = '1' then
user_regi <= (others => '0');
elsif rising_edge(bs_clk1) then
if bs_shift = '1' then
user_regi <= bs_tdi & user_regi(user_regi'left downto 1);
end if;
end if;
end process;
piso:
process (bs_rst, bs_clk1, bs_shift, user_rego)
begin
bs_tdo <= user_rego(0);
if bs_rst = '1' then
user_rego <= (others => '0');
elsif rising_edge(bs_clk1) then
if bs_shift = '1' then
user_rego <= user_rego(0) & user_rego(user_rego'left downto 1);
else
user_rego <= (user_rego'left downto dmem_data_t'length => '0') & jtag_ld_dout;
-- user_rego <= id;
end if;
end if;
end process;
--------------------------------------------------------------------------
-- ROM Read/Write
--------------------------------------------------------------------------
PROM_READ:
process(clk, ce)
begin
if rising_edge(clk) and ce = '1' then
dout <= xmem_rom(to_integer(addr));
end if;
end process;
PROM_WRITE:
process(jtag_ld_clk, jtag_ld_we)
begin
if rising_edge(jtag_ld_clk) then
if jtag_ld_we = '1' then
xmem_rom(to_integer(jtag_ld_addr)) <= jtag_ld_din;
else
jtag_ld_dout <= xmem_rom(to_integer(jtag_ld_addr));
end if;
end if;
end process;
--------------------------------------------------------------------------
end loadable;
-88
View File
@@ -1,88 +0,0 @@
-------------------------------------------------------------------------
-- Project: JCPU, a portable 8-bit RISC CPU written in VHDL
-- This file: The ROM file for use in your VHDL design
--
-- Copyright (C) 2007 J. Ahrensfeld
--
-- This program is free software: you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
-- the Free Software Foundation, either version 3 of the License, or
-- (at your option) any later version.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU General Public License for more details.
--
-- You should have received a copy of the GNU General Public License
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
--
-- For questions and ideas, please contact the author at jens@jayfield.org
--
--------------------------------------------------------------------------
LIBRARY ieee;
use IEEE.STD_LOGIC_1164.ALL;
USE ieee.numeric_std.ALL;
library work;
use work.cpu_pkg.all;
-- JASM_ROM_INSERT_HERE
ENTITY irom IS
Port (
clk : in STD_LOGIC;
ce : in STD_LOGIC;
addr : in inst_addr_t;
dout : out inst_t
);
END irom;
ARCHITECTURE mul8x8 OF irom IS
type imem_rom_t is array (0 to 26) of inst_t;
-- Assembled from mul8x8.jsm
constant imem_rom : imem_rom_t :=
(
"110000" & X"001", -- 0x000: JMP 0x001
"000011" & X"450", -- 0x001: MOV R00, 0x45
"000011" & X"F51", -- 0x002: MOV R01, 0xF5
"111011" & X"005", -- 0x003: CALL 0x005
"110000" & X"004", -- 0x004: JMP 0x004
"111100" & X"002", -- 0x005: PUSH R02
"111100" & X"003", -- 0x006: PUSH R03
"111100" & X"004", -- 0x007: PUSH R04
"000010" & X"014", -- 0x008: MOV R04, R01
"000011" & X"001", -- 0x009: MOV R01, 0x00
"000011" & X"002", -- 0x00A: MOV R02, 0x00
"000011" & X"003", -- 0x00B: MOV R03, 0x00
"001111" & X"014", -- 0x00C: CMP R04, 0x01
"111001" & X"015", -- 0x00D: JEQ 0x015
"011111" & X"004", -- 0x00E: SHR R04
"110100" & X"012", -- 0x00F: JNC 0x012
"010000" & X"002", -- 0x010: ADD R02, R00
"010010" & X"013", -- 0x011: ADDC R03, R01
"011110" & X"000", -- 0x012: SHL R00
"100010" & X"001", -- 0x013: ROLC R01
"110000" & X"00C", -- 0x014: JMP 0x00C
"010000" & X"020", -- 0x015: ADD R00, R02
"010010" & X"031", -- 0x016: ADDC R01, R03
"111101" & X"004", -- 0x017: POP R04
"111101" & X"003", -- 0x018: POP R03
"111101" & X"002", -- 0x019: POP R02
"111110" & X"000" -- 0x01A: RET
);
begin
PROM_READ:
process(clk, ce)
begin
if rising_edge(clk) and ce = '1' then
dout <= imem_rom(to_integer(addr));
end if;
end process;
end mul8x8;
File diff suppressed because it is too large Load Diff
-317
View File
@@ -1,317 +0,0 @@
-------------------------------------------------------------------------
-- Project: JCPU, a portable 8-bit RISC CPU written in VHDL
-- This file: The ROM file for use in your VHDL design
--
-- Copyright (C) 2007 J. Ahrensfeld
--
-- This program is free software: you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
-- the Free Software Foundation, either version 3 of the License, or
-- (at your option) any later version.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU General Public License for more details.
--
-- You should have received a copy of the GNU General Public License
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
--
-- For questions and ideas, please contact the author at jens@jayfield.org
--
--------------------------------------------------------------------------
LIBRARY ieee;
use IEEE.STD_LOGIC_1164.ALL;
USE ieee.numeric_std.ALL;
library work;
use work.cpu_pkg.all;
-- JASM_ROM_INSERT_HERE
ENTITY xrom IS
Port (
clk : in STD_LOGIC;
ce : in STD_LOGIC;
addr : in dmem_addr_t;
dout : out dmem_data_t
);
END xrom;
ARCHITECTURE mul8x8 OF xrom IS
type xmem_rom_t is array (0 to 255) of dmem_data_t;
-- Assembled from mul8x8.jsm
constant xmem_rom : xmem_rom_t :=
(
X"00", -- 0x00
X"00", -- 0x01
X"00", -- 0x02
X"00", -- 0x03
X"00", -- 0x04
X"00", -- 0x05
X"00", -- 0x06
X"00", -- 0x07
X"00", -- 0x08
X"00", -- 0x09
X"00", -- 0x0A
X"00", -- 0x0B
X"00", -- 0x0C
X"00", -- 0x0D
X"00", -- 0x0E
X"00", -- 0x0F
X"00", -- 0x10
X"00", -- 0x11
X"00", -- 0x12
X"00", -- 0x13
X"00", -- 0x14
X"00", -- 0x15
X"00", -- 0x16
X"00", -- 0x17
X"00", -- 0x18
X"00", -- 0x19
X"00", -- 0x1A
X"00", -- 0x1B
X"00", -- 0x1C
X"00", -- 0x1D
X"00", -- 0x1E
X"00", -- 0x1F
X"00", -- 0x20
X"00", -- 0x21
X"00", -- 0x22
X"00", -- 0x23
X"00", -- 0x24
X"00", -- 0x25
X"00", -- 0x26
X"00", -- 0x27
X"00", -- 0x28
X"00", -- 0x29
X"00", -- 0x2A
X"00", -- 0x2B
X"00", -- 0x2C
X"00", -- 0x2D
X"00", -- 0x2E
X"00", -- 0x2F
X"00", -- 0x30
X"00", -- 0x31
X"00", -- 0x32
X"00", -- 0x33
X"00", -- 0x34
X"00", -- 0x35
X"00", -- 0x36
X"00", -- 0x37
X"00", -- 0x38
X"00", -- 0x39
X"00", -- 0x3A
X"00", -- 0x3B
X"00", -- 0x3C
X"00", -- 0x3D
X"00", -- 0x3E
X"00", -- 0x3F
X"00", -- 0x40
X"00", -- 0x41
X"00", -- 0x42
X"00", -- 0x43
X"00", -- 0x44
X"00", -- 0x45
X"00", -- 0x46
X"00", -- 0x47
X"00", -- 0x48
X"00", -- 0x49
X"00", -- 0x4A
X"00", -- 0x4B
X"00", -- 0x4C
X"00", -- 0x4D
X"00", -- 0x4E
X"00", -- 0x4F
X"00", -- 0x50
X"00", -- 0x51
X"00", -- 0x52
X"00", -- 0x53
X"00", -- 0x54
X"00", -- 0x55
X"00", -- 0x56
X"00", -- 0x57
X"00", -- 0x58
X"00", -- 0x59
X"00", -- 0x5A
X"00", -- 0x5B
X"00", -- 0x5C
X"00", -- 0x5D
X"00", -- 0x5E
X"00", -- 0x5F
X"00", -- 0x60
X"00", -- 0x61
X"00", -- 0x62
X"00", -- 0x63
X"00", -- 0x64
X"00", -- 0x65
X"00", -- 0x66
X"00", -- 0x67
X"00", -- 0x68
X"00", -- 0x69
X"00", -- 0x6A
X"00", -- 0x6B
X"00", -- 0x6C
X"00", -- 0x6D
X"00", -- 0x6E
X"00", -- 0x6F
X"00", -- 0x70
X"00", -- 0x71
X"00", -- 0x72
X"00", -- 0x73
X"00", -- 0x74
X"00", -- 0x75
X"00", -- 0x76
X"00", -- 0x77
X"00", -- 0x78
X"00", -- 0x79
X"00", -- 0x7A
X"00", -- 0x7B
X"00", -- 0x7C
X"00", -- 0x7D
X"00", -- 0x7E
X"00", -- 0x7F
X"00", -- 0x80
X"00", -- 0x81
X"00", -- 0x82
X"00", -- 0x83
X"00", -- 0x84
X"00", -- 0x85
X"00", -- 0x86
X"00", -- 0x87
X"00", -- 0x88
X"00", -- 0x89
X"00", -- 0x8A
X"00", -- 0x8B
X"00", -- 0x8C
X"00", -- 0x8D
X"00", -- 0x8E
X"00", -- 0x8F
X"00", -- 0x90
X"00", -- 0x91
X"00", -- 0x92
X"00", -- 0x93
X"00", -- 0x94
X"00", -- 0x95
X"00", -- 0x96
X"00", -- 0x97
X"00", -- 0x98
X"00", -- 0x99
X"00", -- 0x9A
X"00", -- 0x9B
X"00", -- 0x9C
X"00", -- 0x9D
X"00", -- 0x9E
X"00", -- 0x9F
X"00", -- 0xA0
X"00", -- 0xA1
X"00", -- 0xA2
X"00", -- 0xA3
X"00", -- 0xA4
X"00", -- 0xA5
X"00", -- 0xA6
X"00", -- 0xA7
X"00", -- 0xA8
X"00", -- 0xA9
X"00", -- 0xAA
X"00", -- 0xAB
X"00", -- 0xAC
X"00", -- 0xAD
X"00", -- 0xAE
X"00", -- 0xAF
X"00", -- 0xB0
X"00", -- 0xB1
X"00", -- 0xB2
X"00", -- 0xB3
X"00", -- 0xB4
X"00", -- 0xB5
X"00", -- 0xB6
X"00", -- 0xB7
X"00", -- 0xB8
X"00", -- 0xB9
X"00", -- 0xBA
X"00", -- 0xBB
X"00", -- 0xBC
X"00", -- 0xBD
X"00", -- 0xBE
X"00", -- 0xBF
X"00", -- 0xC0
X"00", -- 0xC1
X"00", -- 0xC2
X"00", -- 0xC3
X"00", -- 0xC4
X"00", -- 0xC5
X"00", -- 0xC6
X"00", -- 0xC7
X"00", -- 0xC8
X"00", -- 0xC9
X"00", -- 0xCA
X"00", -- 0xCB
X"00", -- 0xCC
X"00", -- 0xCD
X"00", -- 0xCE
X"00", -- 0xCF
X"00", -- 0xD0
X"00", -- 0xD1
X"00", -- 0xD2
X"00", -- 0xD3
X"00", -- 0xD4
X"00", -- 0xD5
X"00", -- 0xD6
X"00", -- 0xD7
X"00", -- 0xD8
X"00", -- 0xD9
X"00", -- 0xDA
X"00", -- 0xDB
X"00", -- 0xDC
X"00", -- 0xDD
X"00", -- 0xDE
X"00", -- 0xDF
X"00", -- 0xE0
X"00", -- 0xE1
X"00", -- 0xE2
X"00", -- 0xE3
X"00", -- 0xE4
X"00", -- 0xE5
X"00", -- 0xE6
X"00", -- 0xE7
X"00", -- 0xE8
X"00", -- 0xE9
X"00", -- 0xEA
X"00", -- 0xEB
X"00", -- 0xEC
X"00", -- 0xED
X"00", -- 0xEE
X"00", -- 0xEF
X"00", -- 0xF0
X"00", -- 0xF1
X"00", -- 0xF2
X"00", -- 0xF3
X"00", -- 0xF4
X"00", -- 0xF5
X"00", -- 0xF6
X"00", -- 0xF7
X"00", -- 0xF8
X"00", -- 0xF9
X"00", -- 0xFA
X"00", -- 0xFB
X"00", -- 0xFC
X"00", -- 0xFD
X"00", -- 0xFE
X"00" -- 0xFF
);
begin
PROM_READ:
process(clk, ce)
begin
if rising_edge(clk) and ce = '1' then
dout <= xmem_rom(to_integer(addr));
end if;
end process;
end mul8x8;
-413
View File
@@ -1,413 +0,0 @@
-------------------------------------------------------------------------
-- Project: JCPU, a portable 8-bit RISC CPU written in VHDL
-- This file: loadable ROM
--
-- Copyright (C) 2007 J. Ahrensfeld
--
-- This program is free software: you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
-- the Free Software Foundation, either version 3 of the License, or
-- (at your option) any later version.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU General Public License for more details.
--
-- You should have received a copy of the GNU General Public License
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
--
-- For questions and ideas, please contact the author at jens@jayfield.org
--
--------------------------------------------------------------------------
LIBRARY ieee;
use IEEE.STD_LOGIC_1164.ALL;
USE ieee.numeric_std.ALL;
library UNISIM;
use UNISIM.VComponents.all;
library work;
use work.cpu_pkg.all;
ENTITY xrom IS
Port (
clk : in STD_LOGIC;
ce : in STD_LOGIC;
addr : in dmem_addr_t;
dout : out dmem_data_t
);
END xrom;
ARCHITECTURE loadable OF xrom IS
-- JASM_ROM_INSERT_HERE
-- Assembled from mul8x8.jsm
type xmem_rom_t is array (0 to 255) of dmem_data_t;
signal xmem_rom : xmem_rom_t :=
(
X"00", -- 0x00
X"00", -- 0x01
X"00", -- 0x02
X"00", -- 0x03
X"00", -- 0x04
X"00", -- 0x05
X"00", -- 0x06
X"00", -- 0x07
X"00", -- 0x08
X"00", -- 0x09
X"00", -- 0x0A
X"00", -- 0x0B
X"00", -- 0x0C
X"00", -- 0x0D
X"00", -- 0x0E
X"00", -- 0x0F
X"00", -- 0x10
X"00", -- 0x11
X"00", -- 0x12
X"00", -- 0x13
X"00", -- 0x14
X"00", -- 0x15
X"00", -- 0x16
X"00", -- 0x17
X"00", -- 0x18
X"00", -- 0x19
X"00", -- 0x1A
X"00", -- 0x1B
X"00", -- 0x1C
X"00", -- 0x1D
X"00", -- 0x1E
X"00", -- 0x1F
X"00", -- 0x20
X"00", -- 0x21
X"00", -- 0x22
X"00", -- 0x23
X"00", -- 0x24
X"00", -- 0x25
X"00", -- 0x26
X"00", -- 0x27
X"00", -- 0x28
X"00", -- 0x29
X"00", -- 0x2A
X"00", -- 0x2B
X"00", -- 0x2C
X"00", -- 0x2D
X"00", -- 0x2E
X"00", -- 0x2F
X"00", -- 0x30
X"00", -- 0x31
X"00", -- 0x32
X"00", -- 0x33
X"00", -- 0x34
X"00", -- 0x35
X"00", -- 0x36
X"00", -- 0x37
X"00", -- 0x38
X"00", -- 0x39
X"00", -- 0x3A
X"00", -- 0x3B
X"00", -- 0x3C
X"00", -- 0x3D
X"00", -- 0x3E
X"00", -- 0x3F
X"00", -- 0x40
X"00", -- 0x41
X"00", -- 0x42
X"00", -- 0x43
X"00", -- 0x44
X"00", -- 0x45
X"00", -- 0x46
X"00", -- 0x47
X"00", -- 0x48
X"00", -- 0x49
X"00", -- 0x4A
X"00", -- 0x4B
X"00", -- 0x4C
X"00", -- 0x4D
X"00", -- 0x4E
X"00", -- 0x4F
X"00", -- 0x50
X"00", -- 0x51
X"00", -- 0x52
X"00", -- 0x53
X"00", -- 0x54
X"00", -- 0x55
X"00", -- 0x56
X"00", -- 0x57
X"00", -- 0x58
X"00", -- 0x59
X"00", -- 0x5A
X"00", -- 0x5B
X"00", -- 0x5C
X"00", -- 0x5D
X"00", -- 0x5E
X"00", -- 0x5F
X"00", -- 0x60
X"00", -- 0x61
X"00", -- 0x62
X"00", -- 0x63
X"00", -- 0x64
X"00", -- 0x65
X"00", -- 0x66
X"00", -- 0x67
X"00", -- 0x68
X"00", -- 0x69
X"00", -- 0x6A
X"00", -- 0x6B
X"00", -- 0x6C
X"00", -- 0x6D
X"00", -- 0x6E
X"00", -- 0x6F
X"00", -- 0x70
X"00", -- 0x71
X"00", -- 0x72
X"00", -- 0x73
X"00", -- 0x74
X"00", -- 0x75
X"00", -- 0x76
X"00", -- 0x77
X"00", -- 0x78
X"00", -- 0x79
X"00", -- 0x7A
X"00", -- 0x7B
X"00", -- 0x7C
X"00", -- 0x7D
X"00", -- 0x7E
X"00", -- 0x7F
X"00", -- 0x80
X"00", -- 0x81
X"00", -- 0x82
X"00", -- 0x83
X"00", -- 0x84
X"00", -- 0x85
X"00", -- 0x86
X"00", -- 0x87
X"00", -- 0x88
X"00", -- 0x89
X"00", -- 0x8A
X"00", -- 0x8B
X"00", -- 0x8C
X"00", -- 0x8D
X"00", -- 0x8E
X"00", -- 0x8F
X"00", -- 0x90
X"00", -- 0x91
X"00", -- 0x92
X"00", -- 0x93
X"00", -- 0x94
X"00", -- 0x95
X"00", -- 0x96
X"00", -- 0x97
X"00", -- 0x98
X"00", -- 0x99
X"00", -- 0x9A
X"00", -- 0x9B
X"00", -- 0x9C
X"00", -- 0x9D
X"00", -- 0x9E
X"00", -- 0x9F
X"00", -- 0xA0
X"00", -- 0xA1
X"00", -- 0xA2
X"00", -- 0xA3
X"00", -- 0xA4
X"00", -- 0xA5
X"00", -- 0xA6
X"00", -- 0xA7
X"00", -- 0xA8
X"00", -- 0xA9
X"00", -- 0xAA
X"00", -- 0xAB
X"00", -- 0xAC
X"00", -- 0xAD
X"00", -- 0xAE
X"00", -- 0xAF
X"00", -- 0xB0
X"00", -- 0xB1
X"00", -- 0xB2
X"00", -- 0xB3
X"00", -- 0xB4
X"00", -- 0xB5
X"00", -- 0xB6
X"00", -- 0xB7
X"00", -- 0xB8
X"00", -- 0xB9
X"00", -- 0xBA
X"00", -- 0xBB
X"00", -- 0xBC
X"00", -- 0xBD
X"00", -- 0xBE
X"00", -- 0xBF
X"00", -- 0xC0
X"00", -- 0xC1
X"00", -- 0xC2
X"00", -- 0xC3
X"00", -- 0xC4
X"00", -- 0xC5
X"00", -- 0xC6
X"00", -- 0xC7
X"00", -- 0xC8
X"00", -- 0xC9
X"00", -- 0xCA
X"00", -- 0xCB
X"00", -- 0xCC
X"00", -- 0xCD
X"00", -- 0xCE
X"00", -- 0xCF
X"00", -- 0xD0
X"00", -- 0xD1
X"00", -- 0xD2
X"00", -- 0xD3
X"00", -- 0xD4
X"00", -- 0xD5
X"00", -- 0xD6
X"00", -- 0xD7
X"00", -- 0xD8
X"00", -- 0xD9
X"00", -- 0xDA
X"00", -- 0xDB
X"00", -- 0xDC
X"00", -- 0xDD
X"00", -- 0xDE
X"00", -- 0xDF
X"00", -- 0xE0
X"00", -- 0xE1
X"00", -- 0xE2
X"00", -- 0xE3
X"00", -- 0xE4
X"00", -- 0xE5
X"00", -- 0xE6
X"00", -- 0xE7
X"00", -- 0xE8
X"00", -- 0xE9
X"00", -- 0xEA
X"00", -- 0xEB
X"00", -- 0xEC
X"00", -- 0xED
X"00", -- 0xEE
X"00", -- 0xEF
X"00", -- 0xF0
X"00", -- 0xF1
X"00", -- 0xF2
X"00", -- 0xF3
X"00", -- 0xF4
X"00", -- 0xF5
X"00", -- 0xF6
X"00", -- 0xF7
X"00", -- 0xF8
X"00", -- 0xF9
X"00", -- 0xFA
X"00", -- 0xFB
X"00", -- 0xFC
X"00", -- 0xFD
X"00", -- 0xFE
X"00" -- 0xFF
);
signal jtag_ld_clk : STD_LOGIC;
signal jtag_ld_we : STD_LOGIC;
signal jtag_ld_addr : dmem_addr_t;
signal jtag_ld_dout : dmem_data_t;
signal jtag_ld_din : dmem_data_t;
signal bs_rst, bs_sel, bs_shift, bs_tdi, bs_tdo : std_logic;
signal bs_capture, bs_clk0, bs_clk1, bs_update0, bs_update1 : std_logic;
signal user_regi, user_rego : unsigned (15 downto 0);
constant id : unsigned (15 downto 0) := X"BEEF";
begin
--------------------------------------------------------------------------
-- Virtex-4: JTAG Loader
--------------------------------------------------------------------------
i00_BUFG : BUFG
port map
(
O => bs_clk1,
I => bs_clk0
);
i01_BUFG : BUFG
port map
(
O => bs_update1,
I => bs_update0
);
BSCAN_VIRTEX4_inst2 : BSCAN_VIRTEX4
generic map
(
JTAG_CHAIN => 2 -- Value to set BSCAN site of device. Possible values: (1,2,3 or 4)
)
port map
(
CAPTURE => bs_capture, -- CAPTURE output from TAP controller
DRCK => bs_clk0, -- Data register output for USER functions
RESET => bs_rst, -- Reset output from TAP controller
SEL => bs_sel, -- USER active output
SHIFT => bs_shift, -- SHIFT output from TAP controller
TDI => bs_tdi, -- TDI output from TAP controller
UPDATE => bs_update0, -- UPDATE output from TAP controller
TDO => bs_tdo -- Data input for USER function
);
jtag_ld_addr <= user_regi(user_regi'left downto user_regi'left-dmem_data_t'length+1);
jtag_ld_din <= user_regi(dmem_data_t'left downto 0);
jtag_ld_clk <= bs_update1;
jtag_ld_we <= bs_sel;
sipo:
process (bs_rst, bs_clk1, bs_tdi, bs_shift)
begin
if bs_rst = '1' then
user_regi <= (others => '0');
elsif rising_edge(bs_clk1) then
if bs_shift = '1' then
user_regi <= bs_tdi & user_regi(user_regi'left downto 1);
end if;
end if;
end process;
piso:
process (bs_rst, bs_clk1, bs_shift, user_rego)
begin
bs_tdo <= user_rego(0);
if bs_rst = '1' then
user_rego <= (others => '0');
elsif rising_edge(bs_clk1) then
if bs_shift = '1' then
user_rego <= user_rego(0) & user_rego(user_rego'left downto 1);
else
user_rego <= (user_rego'left downto dmem_data_t'length => '0') & jtag_ld_dout;
-- user_rego <= id;
end if;
end if;
end process;
--------------------------------------------------------------------------
-- ROM Read/Write
--------------------------------------------------------------------------
PROM_READ:
process(clk, ce)
begin
if rising_edge(clk) and ce = '1' then
dout <= xmem_rom(to_integer(addr));
end if;
end process;
PROM_WRITE:
process(jtag_ld_clk, jtag_ld_we)
begin
if rising_edge(jtag_ld_clk) then
if jtag_ld_we = '1' then
xmem_rom(to_integer(jtag_ld_addr)) <= jtag_ld_din;
else
jtag_ld_dout <= xmem_rom(to_integer(jtag_ld_addr));
end if;
end if;
end process;
--------------------------------------------------------------------------
end loadable;
-89
View File
@@ -1,89 +0,0 @@
-------------------------------------------------------------------------
-- Project: JCPU, a portable 8-bit RISC CPU written in VHDL
-- This file: The ROM file for use in your VHDL design
--
-- Copyright (C) 2007 J. Ahrensfeld
--
-- This program is free software: you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
-- the Free Software Foundation, either version 3 of the License, or
-- (at your option) any later version.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU General Public License for more details.
--
-- You should have received a copy of the GNU General Public License
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
--
-- For questions and ideas, please contact the author at jens@jayfield.org
--
--------------------------------------------------------------------------
LIBRARY ieee;
use IEEE.STD_LOGIC_1164.ALL;
USE ieee.numeric_std.ALL;
library work;
use work.cpu_pkg.all;
-- JASM_ROM_INSERT_HERE
ENTITY irom IS
Port (
clk : in STD_LOGIC;
ce : in STD_LOGIC;
addr : in inst_addr_t;
dout : out inst_t
);
END irom;
ARCHITECTURE reti_issue OF irom IS
type imem_rom_t is array (0 to 27) of inst_t;
-- Assembled from reti_issue.jsm
constant imem_rom : imem_rom_t :=
(
"110000" & X"002", -- 0x000: JMP 0x002
"111111" & X"000", -- 0x001: RETI
"000011" & X"050", -- 0x002: MOV R00, 0x05
"100110" & X"030", -- 0x003: COUT (0x03), R00
"000011" & X"000", -- 0x004: MOV R00, 0x00
"000000" & X"000", -- 0x005: NOP
"010001" & X"010", -- 0x006: INC R00
"000000" & X"000", -- 0x007: NOP
"111011" & X"01B", -- 0x008: CALL 0x01B
"000000" & X"000", -- 0x009: NOP
"111100" & X"003", -- 0x00A: PUSH R03
"000000" & X"000", -- 0x00B: NOP
"111100" & X"002", -- 0x00C: PUSH R02
"000000" & X"000", -- 0x00D: NOP
"111100" & X"001", -- 0x00E: PUSH R01
"000000" & X"000", -- 0x00F: NOP
"111100" & X"000", -- 0x010: PUSH R00
"000000" & X"000", -- 0x011: NOP
"111101" & X"000", -- 0x012: POP R00
"000000" & X"000", -- 0x013: NOP
"111101" & X"001", -- 0x014: POP R01
"000000" & X"000", -- 0x015: NOP
"111101" & X"002", -- 0x016: POP R02
"000000" & X"000", -- 0x017: NOP
"111101" & X"003", -- 0x018: POP R03
"000000" & X"000", -- 0x019: NOP
"110000" & X"005", -- 0x01A: JMP 0x005
"111110" & X"000" -- 0x01B: RET
);
begin
PROM_READ:
process(clk, ce)
begin
if rising_edge(clk) and ce = '1' then
dout <= imem_rom(to_integer(addr));
end if;
end process;
end reti_issue;
File diff suppressed because it is too large Load Diff
-317
View File
@@ -1,317 +0,0 @@
-------------------------------------------------------------------------
-- Project: JCPU, a portable 8-bit RISC CPU written in VHDL
-- This file: The ROM file for use in your VHDL design
--
-- Copyright (C) 2007 J. Ahrensfeld
--
-- This program is free software: you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
-- the Free Software Foundation, either version 3 of the License, or
-- (at your option) any later version.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU General Public License for more details.
--
-- You should have received a copy of the GNU General Public License
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
--
-- For questions and ideas, please contact the author at jens@jayfield.org
--
--------------------------------------------------------------------------
LIBRARY ieee;
use IEEE.STD_LOGIC_1164.ALL;
USE ieee.numeric_std.ALL;
library work;
use work.cpu_pkg.all;
-- JASM_ROM_INSERT_HERE
ENTITY xrom IS
Port (
clk : in STD_LOGIC;
ce : in STD_LOGIC;
addr : in dmem_addr_t;
dout : out dmem_data_t
);
END xrom;
ARCHITECTURE reti_issue OF xrom IS
type xmem_rom_t is array (0 to 255) of dmem_data_t;
-- Assembled from reti_issue.jsm
constant xmem_rom : xmem_rom_t :=
(
X"00", -- 0x00
X"00", -- 0x01
X"00", -- 0x02
X"00", -- 0x03
X"00", -- 0x04
X"00", -- 0x05
X"00", -- 0x06
X"00", -- 0x07
X"00", -- 0x08
X"00", -- 0x09
X"00", -- 0x0A
X"00", -- 0x0B
X"00", -- 0x0C
X"00", -- 0x0D
X"00", -- 0x0E
X"00", -- 0x0F
X"00", -- 0x10
X"00", -- 0x11
X"00", -- 0x12
X"00", -- 0x13
X"00", -- 0x14
X"00", -- 0x15
X"00", -- 0x16
X"00", -- 0x17
X"00", -- 0x18
X"00", -- 0x19
X"00", -- 0x1A
X"00", -- 0x1B
X"00", -- 0x1C
X"00", -- 0x1D
X"00", -- 0x1E
X"00", -- 0x1F
X"00", -- 0x20
X"00", -- 0x21
X"00", -- 0x22
X"00", -- 0x23
X"00", -- 0x24
X"00", -- 0x25
X"00", -- 0x26
X"00", -- 0x27
X"00", -- 0x28
X"00", -- 0x29
X"00", -- 0x2A
X"00", -- 0x2B
X"00", -- 0x2C
X"00", -- 0x2D
X"00", -- 0x2E
X"00", -- 0x2F
X"00", -- 0x30
X"00", -- 0x31
X"00", -- 0x32
X"00", -- 0x33
X"00", -- 0x34
X"00", -- 0x35
X"00", -- 0x36
X"00", -- 0x37
X"00", -- 0x38
X"00", -- 0x39
X"00", -- 0x3A
X"00", -- 0x3B
X"00", -- 0x3C
X"00", -- 0x3D
X"00", -- 0x3E
X"00", -- 0x3F
X"00", -- 0x40
X"00", -- 0x41
X"00", -- 0x42
X"00", -- 0x43
X"00", -- 0x44
X"00", -- 0x45
X"00", -- 0x46
X"00", -- 0x47
X"00", -- 0x48
X"00", -- 0x49
X"00", -- 0x4A
X"00", -- 0x4B
X"00", -- 0x4C
X"00", -- 0x4D
X"00", -- 0x4E
X"00", -- 0x4F
X"00", -- 0x50
X"00", -- 0x51
X"00", -- 0x52
X"00", -- 0x53
X"00", -- 0x54
X"00", -- 0x55
X"00", -- 0x56
X"00", -- 0x57
X"00", -- 0x58
X"00", -- 0x59
X"00", -- 0x5A
X"00", -- 0x5B
X"00", -- 0x5C
X"00", -- 0x5D
X"00", -- 0x5E
X"00", -- 0x5F
X"00", -- 0x60
X"00", -- 0x61
X"00", -- 0x62
X"00", -- 0x63
X"00", -- 0x64
X"00", -- 0x65
X"00", -- 0x66
X"00", -- 0x67
X"00", -- 0x68
X"00", -- 0x69
X"00", -- 0x6A
X"00", -- 0x6B
X"00", -- 0x6C
X"00", -- 0x6D
X"00", -- 0x6E
X"00", -- 0x6F
X"00", -- 0x70
X"00", -- 0x71
X"00", -- 0x72
X"00", -- 0x73
X"00", -- 0x74
X"00", -- 0x75
X"00", -- 0x76
X"00", -- 0x77
X"00", -- 0x78
X"00", -- 0x79
X"00", -- 0x7A
X"00", -- 0x7B
X"00", -- 0x7C
X"00", -- 0x7D
X"00", -- 0x7E
X"00", -- 0x7F
X"00", -- 0x80
X"00", -- 0x81
X"00", -- 0x82
X"00", -- 0x83
X"00", -- 0x84
X"00", -- 0x85
X"00", -- 0x86
X"00", -- 0x87
X"00", -- 0x88
X"00", -- 0x89
X"00", -- 0x8A
X"00", -- 0x8B
X"00", -- 0x8C
X"00", -- 0x8D
X"00", -- 0x8E
X"00", -- 0x8F
X"00", -- 0x90
X"00", -- 0x91
X"00", -- 0x92
X"00", -- 0x93
X"00", -- 0x94
X"00", -- 0x95
X"00", -- 0x96
X"00", -- 0x97
X"00", -- 0x98
X"00", -- 0x99
X"00", -- 0x9A
X"00", -- 0x9B
X"00", -- 0x9C
X"00", -- 0x9D
X"00", -- 0x9E
X"00", -- 0x9F
X"00", -- 0xA0
X"00", -- 0xA1
X"00", -- 0xA2
X"00", -- 0xA3
X"00", -- 0xA4
X"00", -- 0xA5
X"00", -- 0xA6
X"00", -- 0xA7
X"00", -- 0xA8
X"00", -- 0xA9
X"00", -- 0xAA
X"00", -- 0xAB
X"00", -- 0xAC
X"00", -- 0xAD
X"00", -- 0xAE
X"00", -- 0xAF
X"00", -- 0xB0
X"00", -- 0xB1
X"00", -- 0xB2
X"00", -- 0xB3
X"00", -- 0xB4
X"00", -- 0xB5
X"00", -- 0xB6
X"00", -- 0xB7
X"00", -- 0xB8
X"00", -- 0xB9
X"00", -- 0xBA
X"00", -- 0xBB
X"00", -- 0xBC
X"00", -- 0xBD
X"00", -- 0xBE
X"00", -- 0xBF
X"00", -- 0xC0
X"00", -- 0xC1
X"00", -- 0xC2
X"00", -- 0xC3
X"00", -- 0xC4
X"00", -- 0xC5
X"00", -- 0xC6
X"00", -- 0xC7
X"00", -- 0xC8
X"00", -- 0xC9
X"00", -- 0xCA
X"00", -- 0xCB
X"00", -- 0xCC
X"00", -- 0xCD
X"00", -- 0xCE
X"00", -- 0xCF
X"00", -- 0xD0
X"00", -- 0xD1
X"00", -- 0xD2
X"00", -- 0xD3
X"00", -- 0xD4
X"00", -- 0xD5
X"00", -- 0xD6
X"00", -- 0xD7
X"00", -- 0xD8
X"00", -- 0xD9
X"00", -- 0xDA
X"00", -- 0xDB
X"00", -- 0xDC
X"00", -- 0xDD
X"00", -- 0xDE
X"00", -- 0xDF
X"00", -- 0xE0
X"00", -- 0xE1
X"00", -- 0xE2
X"00", -- 0xE3
X"00", -- 0xE4
X"00", -- 0xE5
X"00", -- 0xE6
X"00", -- 0xE7
X"00", -- 0xE8
X"00", -- 0xE9
X"00", -- 0xEA
X"00", -- 0xEB
X"00", -- 0xEC
X"00", -- 0xED
X"00", -- 0xEE
X"00", -- 0xEF
X"00", -- 0xF0
X"00", -- 0xF1
X"00", -- 0xF2
X"00", -- 0xF3
X"00", -- 0xF4
X"00", -- 0xF5
X"00", -- 0xF6
X"00", -- 0xF7
X"00", -- 0xF8
X"00", -- 0xF9
X"00", -- 0xFA
X"00", -- 0xFB
X"00", -- 0xFC
X"00", -- 0xFD
X"00", -- 0xFE
X"00" -- 0xFF
);
begin
PROM_READ:
process(clk, ce)
begin
if rising_edge(clk) and ce = '1' then
dout <= xmem_rom(to_integer(addr));
end if;
end process;
end reti_issue;
-413
View File
@@ -1,413 +0,0 @@
-------------------------------------------------------------------------
-- Project: JCPU, a portable 8-bit RISC CPU written in VHDL
-- This file: loadable ROM
--
-- Copyright (C) 2007 J. Ahrensfeld
--
-- This program is free software: you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
-- the Free Software Foundation, either version 3 of the License, or
-- (at your option) any later version.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU General Public License for more details.
--
-- You should have received a copy of the GNU General Public License
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
--
-- For questions and ideas, please contact the author at jens@jayfield.org
--
--------------------------------------------------------------------------
LIBRARY ieee;
use IEEE.STD_LOGIC_1164.ALL;
USE ieee.numeric_std.ALL;
library UNISIM;
use UNISIM.VComponents.all;
library work;
use work.cpu_pkg.all;
ENTITY xrom IS
Port (
clk : in STD_LOGIC;
ce : in STD_LOGIC;
addr : in dmem_addr_t;
dout : out dmem_data_t
);
END xrom;
ARCHITECTURE loadable OF xrom IS
-- JASM_ROM_INSERT_HERE
-- Assembled from reti_issue.jsm
type xmem_rom_t is array (0 to 255) of dmem_data_t;
signal xmem_rom : xmem_rom_t :=
(
X"00", -- 0x00
X"00", -- 0x01
X"00", -- 0x02
X"00", -- 0x03
X"00", -- 0x04
X"00", -- 0x05
X"00", -- 0x06
X"00", -- 0x07
X"00", -- 0x08
X"00", -- 0x09
X"00", -- 0x0A
X"00", -- 0x0B
X"00", -- 0x0C
X"00", -- 0x0D
X"00", -- 0x0E
X"00", -- 0x0F
X"00", -- 0x10
X"00", -- 0x11
X"00", -- 0x12
X"00", -- 0x13
X"00", -- 0x14
X"00", -- 0x15
X"00", -- 0x16
X"00", -- 0x17
X"00", -- 0x18
X"00", -- 0x19
X"00", -- 0x1A
X"00", -- 0x1B
X"00", -- 0x1C
X"00", -- 0x1D
X"00", -- 0x1E
X"00", -- 0x1F
X"00", -- 0x20
X"00", -- 0x21
X"00", -- 0x22
X"00", -- 0x23
X"00", -- 0x24
X"00", -- 0x25
X"00", -- 0x26
X"00", -- 0x27
X"00", -- 0x28
X"00", -- 0x29
X"00", -- 0x2A
X"00", -- 0x2B
X"00", -- 0x2C
X"00", -- 0x2D
X"00", -- 0x2E
X"00", -- 0x2F
X"00", -- 0x30
X"00", -- 0x31
X"00", -- 0x32
X"00", -- 0x33
X"00", -- 0x34
X"00", -- 0x35
X"00", -- 0x36
X"00", -- 0x37
X"00", -- 0x38
X"00", -- 0x39
X"00", -- 0x3A
X"00", -- 0x3B
X"00", -- 0x3C
X"00", -- 0x3D
X"00", -- 0x3E
X"00", -- 0x3F
X"00", -- 0x40
X"00", -- 0x41
X"00", -- 0x42
X"00", -- 0x43
X"00", -- 0x44
X"00", -- 0x45
X"00", -- 0x46
X"00", -- 0x47
X"00", -- 0x48
X"00", -- 0x49
X"00", -- 0x4A
X"00", -- 0x4B
X"00", -- 0x4C
X"00", -- 0x4D
X"00", -- 0x4E
X"00", -- 0x4F
X"00", -- 0x50
X"00", -- 0x51
X"00", -- 0x52
X"00", -- 0x53
X"00", -- 0x54
X"00", -- 0x55
X"00", -- 0x56
X"00", -- 0x57
X"00", -- 0x58
X"00", -- 0x59
X"00", -- 0x5A
X"00", -- 0x5B
X"00", -- 0x5C
X"00", -- 0x5D
X"00", -- 0x5E
X"00", -- 0x5F
X"00", -- 0x60
X"00", -- 0x61
X"00", -- 0x62
X"00", -- 0x63
X"00", -- 0x64
X"00", -- 0x65
X"00", -- 0x66
X"00", -- 0x67
X"00", -- 0x68
X"00", -- 0x69
X"00", -- 0x6A
X"00", -- 0x6B
X"00", -- 0x6C
X"00", -- 0x6D
X"00", -- 0x6E
X"00", -- 0x6F
X"00", -- 0x70
X"00", -- 0x71
X"00", -- 0x72
X"00", -- 0x73
X"00", -- 0x74
X"00", -- 0x75
X"00", -- 0x76
X"00", -- 0x77
X"00", -- 0x78
X"00", -- 0x79
X"00", -- 0x7A
X"00", -- 0x7B
X"00", -- 0x7C
X"00", -- 0x7D
X"00", -- 0x7E
X"00", -- 0x7F
X"00", -- 0x80
X"00", -- 0x81
X"00", -- 0x82
X"00", -- 0x83
X"00", -- 0x84
X"00", -- 0x85
X"00", -- 0x86
X"00", -- 0x87
X"00", -- 0x88
X"00", -- 0x89
X"00", -- 0x8A
X"00", -- 0x8B
X"00", -- 0x8C
X"00", -- 0x8D
X"00", -- 0x8E
X"00", -- 0x8F
X"00", -- 0x90
X"00", -- 0x91
X"00", -- 0x92
X"00", -- 0x93
X"00", -- 0x94
X"00", -- 0x95
X"00", -- 0x96
X"00", -- 0x97
X"00", -- 0x98
X"00", -- 0x99
X"00", -- 0x9A
X"00", -- 0x9B
X"00", -- 0x9C
X"00", -- 0x9D
X"00", -- 0x9E
X"00", -- 0x9F
X"00", -- 0xA0
X"00", -- 0xA1
X"00", -- 0xA2
X"00", -- 0xA3
X"00", -- 0xA4
X"00", -- 0xA5
X"00", -- 0xA6
X"00", -- 0xA7
X"00", -- 0xA8
X"00", -- 0xA9
X"00", -- 0xAA
X"00", -- 0xAB
X"00", -- 0xAC
X"00", -- 0xAD
X"00", -- 0xAE
X"00", -- 0xAF
X"00", -- 0xB0
X"00", -- 0xB1
X"00", -- 0xB2
X"00", -- 0xB3
X"00", -- 0xB4
X"00", -- 0xB5
X"00", -- 0xB6
X"00", -- 0xB7
X"00", -- 0xB8
X"00", -- 0xB9
X"00", -- 0xBA
X"00", -- 0xBB
X"00", -- 0xBC
X"00", -- 0xBD
X"00", -- 0xBE
X"00", -- 0xBF
X"00", -- 0xC0
X"00", -- 0xC1
X"00", -- 0xC2
X"00", -- 0xC3
X"00", -- 0xC4
X"00", -- 0xC5
X"00", -- 0xC6
X"00", -- 0xC7
X"00", -- 0xC8
X"00", -- 0xC9
X"00", -- 0xCA
X"00", -- 0xCB
X"00", -- 0xCC
X"00", -- 0xCD
X"00", -- 0xCE
X"00", -- 0xCF
X"00", -- 0xD0
X"00", -- 0xD1
X"00", -- 0xD2
X"00", -- 0xD3
X"00", -- 0xD4
X"00", -- 0xD5
X"00", -- 0xD6
X"00", -- 0xD7
X"00", -- 0xD8
X"00", -- 0xD9
X"00", -- 0xDA
X"00", -- 0xDB
X"00", -- 0xDC
X"00", -- 0xDD
X"00", -- 0xDE
X"00", -- 0xDF
X"00", -- 0xE0
X"00", -- 0xE1
X"00", -- 0xE2
X"00", -- 0xE3
X"00", -- 0xE4
X"00", -- 0xE5
X"00", -- 0xE6
X"00", -- 0xE7
X"00", -- 0xE8
X"00", -- 0xE9
X"00", -- 0xEA
X"00", -- 0xEB
X"00", -- 0xEC
X"00", -- 0xED
X"00", -- 0xEE
X"00", -- 0xEF
X"00", -- 0xF0
X"00", -- 0xF1
X"00", -- 0xF2
X"00", -- 0xF3
X"00", -- 0xF4
X"00", -- 0xF5
X"00", -- 0xF6
X"00", -- 0xF7
X"00", -- 0xF8
X"00", -- 0xF9
X"00", -- 0xFA
X"00", -- 0xFB
X"00", -- 0xFC
X"00", -- 0xFD
X"00", -- 0xFE
X"00" -- 0xFF
);
signal jtag_ld_clk : STD_LOGIC;
signal jtag_ld_we : STD_LOGIC;
signal jtag_ld_addr : dmem_addr_t;
signal jtag_ld_dout : dmem_data_t;
signal jtag_ld_din : dmem_data_t;
signal bs_rst, bs_sel, bs_shift, bs_tdi, bs_tdo : std_logic;
signal bs_capture, bs_clk0, bs_clk1, bs_update0, bs_update1 : std_logic;
signal user_regi, user_rego : unsigned (15 downto 0);
constant id : unsigned (15 downto 0) := X"BEEF";
begin
--------------------------------------------------------------------------
-- Virtex-4: JTAG Loader
--------------------------------------------------------------------------
i00_BUFG : BUFG
port map
(
O => bs_clk1,
I => bs_clk0
);
i01_BUFG : BUFG
port map
(
O => bs_update1,
I => bs_update0
);
BSCAN_VIRTEX4_inst2 : BSCAN_VIRTEX4
generic map
(
JTAG_CHAIN => 2 -- Value to set BSCAN site of device. Possible values: (1,2,3 or 4)
)
port map
(
CAPTURE => bs_capture, -- CAPTURE output from TAP controller
DRCK => bs_clk0, -- Data register output for USER functions
RESET => bs_rst, -- Reset output from TAP controller
SEL => bs_sel, -- USER active output
SHIFT => bs_shift, -- SHIFT output from TAP controller
TDI => bs_tdi, -- TDI output from TAP controller
UPDATE => bs_update0, -- UPDATE output from TAP controller
TDO => bs_tdo -- Data input for USER function
);
jtag_ld_addr <= user_regi(user_regi'left downto user_regi'left-dmem_data_t'length+1);
jtag_ld_din <= user_regi(dmem_data_t'left downto 0);
jtag_ld_clk <= bs_update1;
jtag_ld_we <= bs_sel;
sipo:
process (bs_rst, bs_clk1, bs_tdi, bs_shift)
begin
if bs_rst = '1' then
user_regi <= (others => '0');
elsif rising_edge(bs_clk1) then
if bs_shift = '1' then
user_regi <= bs_tdi & user_regi(user_regi'left downto 1);
end if;
end if;
end process;
piso:
process (bs_rst, bs_clk1, bs_shift, user_rego)
begin
bs_tdo <= user_rego(0);
if bs_rst = '1' then
user_rego <= (others => '0');
elsif rising_edge(bs_clk1) then
if bs_shift = '1' then
user_rego <= user_rego(0) & user_rego(user_rego'left downto 1);
else
user_rego <= (user_rego'left downto dmem_data_t'length => '0') & jtag_ld_dout;
-- user_rego <= id;
end if;
end if;
end process;
--------------------------------------------------------------------------
-- ROM Read/Write
--------------------------------------------------------------------------
PROM_READ:
process(clk, ce)
begin
if rising_edge(clk) and ce = '1' then
dout <= xmem_rom(to_integer(addr));
end if;
end process;
PROM_WRITE:
process(jtag_ld_clk, jtag_ld_we)
begin
if rising_edge(jtag_ld_clk) then
if jtag_ld_we = '1' then
xmem_rom(to_integer(jtag_ld_addr)) <= jtag_ld_din;
else
jtag_ld_dout <= xmem_rom(to_integer(jtag_ld_addr));
end if;
end if;
end process;
--------------------------------------------------------------------------
end loadable;
-129
View File
@@ -1,129 +0,0 @@
-------------------------------------------------------------------------
-- Project: JCPU, a portable 8-bit RISC CPU written in VHDL
-- This file: testbench for embedded cpu with rom
--
-- Copyright (C) 2007 J. Ahrensfeld
--
-- This program is free software: you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
-- the Free Software Foundation, either version 3 of the License, or
-- (at your option) any later version.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU General Public License for more details.
--
-- You should have received a copy of the GNU General Public License
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
--
-- For questions and ideas, please contact the author at jens@jayfield.org
--
--------------------------------------------------------------------------
LIBRARY ieee;
use IEEE.STD_LOGIC_1164.ALL;
USE ieee.numeric_std.ALL;
use std.textio.all; -- Imports the standard textio package.
library work;
use work.cpu_pkg.all;
ENTITY tb_cpu_embedded IS
END tb_cpu_embedded;
ARCHITECTURE behavior OF tb_cpu_embedded IS
COMPONENT cpu_embedded
Port (
rst : in STD_LOGIC;
clk : in STD_LOGIC;
ce : in STD_LOGIC;
int_in : in STD_LOGIC;
int_ack : out STD_LOGIC;
xmem_wait : in STD_LOGIC;
xmem_we : out STD_LOGIC;
xmem_re : out STD_LOGIC;
xmem_din : in unsigned (DMEM_DATA_WIDTH-1 downto 0);
xmem_dout : out unsigned (DMEM_DATA_WIDTH-1 downto 0);
xmem_addr : out unsigned (DMEM_ADDR_WIDTH-1 downto 0);
io_sel : out STD_LOGIC
);
END COMPONENT;
constant CLK_PERIOD : time := 10 ns;
type sram_t is array (integer range <>) of dmem_data_t;
signal rst : std_logic := '1';
signal clk : std_logic := '1';
signal ce : std_logic := '0';
signal int_in : std_logic := '0';
signal int_ack : std_logic;
signal xmem_wait : std_logic := '0';
signal xmem_din : dmem_data_t := (others => '-');
signal xmem_dout : dmem_data_t;
signal xmem_addr : dmem_addr_t;
signal xmem_we : std_logic;
signal xmem_re : std_logic;
signal io_sel : std_logic;
signal sram : sram_t(0 to 2**dmem_addr_t'length-1);
BEGIN
uut: cpu_embedded
PORT MAP(
rst => rst,
clk => clk,
ce => ce,
int_in => int_in,
int_ack => int_ack,
xmem_wait => xmem_wait,
xmem_we => xmem_we,
xmem_re => xmem_re,
xmem_din => xmem_din,
xmem_dout => xmem_dout,
xmem_addr => xmem_addr,
io_sel => io_sel
);
CLK_GEN: process
begin
wait for CLK_PERIOD/2;
clk <= not clk;
end process;
STIMULUS: process
begin
wait for 3*CLK_PERIOD;
rst <= '0';
wait for 2*CLK_PERIOD;
wait until rising_edge(clk);
ce <= '1';
wait for 1000*CLK_PERIOD;
assert false report "Test finished" severity error;
wait;
end process;
SRAM_RW: process(rst, clk, xmem_addr, xmem_dout, xmem_we)
begin
if (rst = '1') then
xmem_din <= X"00";
elsif rising_edge(clk) then
if io_sel = '0' then
if xmem_we = '1' then
sram(to_integer(xmem_addr)) <= xmem_dout;
end if;
xmem_din <= to_01(sram(to_integer(xmem_addr)));
else
xmem_din <= X"FF";
end if;
end if;
end process;
END;
-218
View File
@@ -1,218 +0,0 @@
-------------------------------------------------------------------------
-- Project: JCPU, a portable 8-bit RISC CPU written in VHDL
-- This file: Formal test of correct function of JCPU,
-- also writes 'opc.lst' for JASM-assembler
--
-- Copyright (C) 2007 J. Ahrensfeld
--
-- This program is free software: you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
-- the Free Software Foundation, either version 3 of the License, or
-- (at your option) any later version.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU General Public License for more details.
--
-- You should have received a copy of the GNU General Public License
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
--
-- For questions and ideas, please contact the author at jens@jayfield.org
--
--------------------------------------------------------------------------
LIBRARY ieee;
use IEEE.STD_LOGIC_1164.ALL;
USE ieee.numeric_std.ALL;
use std.textio.all; -- Imports the standard textio package.
library work;
use work.cpu_pkg.all;
use work.PCK_FIO.all;
ENTITY tb_cpu IS
END tb_cpu;
ARCHITECTURE behavior OF tb_cpu IS
COMPONENT cpu
Generic (
use_instr_register : boolean;
use_ctrl_rom : boolean
);
Port (
rst : in STD_LOGIC;
clk : in STD_LOGIC;
ce : in STD_LOGIC;
int_in : in STD_LOGIC;
int_ack : out STD_LOGIC;
xmem_wait : in STD_LOGIC;
xmem_we : out STD_LOGIC;
xmem_re : out STD_LOGIC;
instr_din : in unsigned (IMEM_DATA_WIDTH-1 downto 0);
instr_addr : out unsigned (IMEM_ADDR_WIDTH-1 downto 0);
xmem_din : in unsigned (DMEM_DATA_WIDTH-1 downto 0);
xmem_dout : out unsigned (DMEM_DATA_WIDTH-1 downto 0);
xmem_addr : out unsigned (DMEM_DATA_WIDTH-1 downto 0);
io_sel : out STD_LOGIC
);
END COMPONENT;
COMPONENT irom
Port (
clk : in STD_LOGIC;
ce : in STD_LOGIC;
addr : in inst_addr_t;
dout : out inst_t
);
END COMPONENT;
constant CLK_PERIOD : time := 10 ns;
type prom_t is array (integer range <>) of inst_t;
type sram_t is array (integer range <>) of dmem_data_t;
signal rst : std_logic := '1';
signal clk : std_logic := '1';
signal ce : std_logic := '0';
signal int_in : std_logic := '0';
signal int_ack : std_logic;
signal xmem_wait : std_logic := '1';
signal irom_data : unsigned (IMEM_DATA_WIDTH-1 downto 0) := (others => '-');
signal irom_addr : unsigned (IMEM_ADDR_WIDTH-1 downto 0);
signal xmem_din : dmem_data_t := (others => '-');
signal xmem_dout : dmem_data_t;
signal xmem_addr : unsigned (DMEM_DATA_WIDTH-1 downto 0);
signal xmem_we : std_logic;
signal xmem_re : std_logic;
signal io_sel : std_logic;
signal sram : sram_t(0 to 2**DMEM_DATA_WIDTH-1);
type reg_t is record
revision : dmem_data_t;
testid : dmem_data_t;
interrupt : std_logic;
end record;
signal reg : reg_t;
BEGIN
int_in <= reg.interrupt;
uut: cpu
GENERIC MAP
(
use_instr_register => false,
use_ctrl_rom => true
)
PORT MAP(
rst => rst,
clk => clk,
ce => ce,
int_in => int_in,
int_ack => int_ack,
xmem_wait => xmem_wait,
xmem_we => xmem_we,
xmem_re => xmem_re,
instr_din => irom_data,
instr_addr => irom_addr,
xmem_din => xmem_din,
xmem_dout => xmem_dout,
xmem_addr => xmem_addr,
io_sel => io_sel
);
the_irom: irom
PORT MAP(
clk => clk,
ce => ce,
addr => irom_addr,
dout => irom_data
);
CLK_GEN: process
begin
wait for CLK_PERIOD/2;
clk <= not clk;
end process;
XWAIT_GEN:process(rst, clk)
variable cnt : unsigned(3 downto 0);
begin
if (rst = '1') then
cnt := (others => '1');
elsif rising_edge(clk) then
if cnt /= "0000" then
cnt := cnt - 1;
else
cnt := (others => '1');
xmem_wait <= not xmem_wait;
end if;
end if;
end process;
STIMULUS: process
file RESULT: text open write_mode is "../tools/opc.list";
variable L: line;
begin
for i in 0 to instr_name_array'length-1 loop
fprint(RESULT, L,"%d %s\n", fo(i), instr_name_array(i));
end loop;
wait for 3*CLK_PERIOD;
rst <= '0';
wait for 2*CLK_PERIOD;
wait until rising_edge(clk);
ce <= '1';
assert false report "Test finished" severity error;
wait;
end process;
SRAM_RW: process(rst, clk)
begin
if (rst = '1') then
reg.revision <= (others => '0');
reg.testid <= (others => '0');
reg.interrupt <= '0';
elsif rising_edge(clk) then
if int_ack = '1' then
-- reg.interrupt <= '0';
end if;
if xmem_we = '1' then
if io_sel = '0' then
sram(to_integer(xmem_addr)) <= xmem_dout;
else
case xmem_addr is
when X"00" =>
reg.revision <= xmem_dout;
when X"01" =>
reg.testid <= xmem_dout;
when X"02" =>
reg.interrupt <= xmem_dout(0);
when others => null;
end case;
end if;
else
if io_sel = '0' then
xmem_din <= to_01(sram(to_integer(xmem_addr)));
else
case xmem_addr is
when X"00" =>
xmem_din <= reg.revision;
when X"01" =>
xmem_din <= reg.testid;
when others =>
xmem_din <= X"BC";
end case;
end if;
end if;
end if;
end process;
END;
-10
View File
@@ -1,10 +0,0 @@
vhdl work "W:\vhdl\lib\CPUs\JCpu\src\core\cpu_pkg.vhd"
vhdl work "W:\vhdl\lib\CPUs\JCpu\src\core\stack_ctrl.vhd"
vhdl work "W:\vhdl\lib\CPUs\JCpu\src\core\reg_dual.vhd"
vhdl work "W:\vhdl\lib\CPUs\JCpu\src\core\pc.vhd"
vhdl work "W:\vhdl\lib\CPUs\JCpu\src\core\int_ctrl.vhd"
vhdl work "W:\vhdl\lib\CPUs\JCpu\src\core\dpath_ctrl.vhd"
vhdl work "W:\vhdl\lib\CPUs\JCpu\src\core\chipreg.vhd"
vhdl work "W:\vhdl\lib\CPUs\JCpu\src\core\chipram.vhd"
vhdl work "W:\vhdl\lib\CPUs\JCpu\src\core\alu.vhd"
vhdl work "W:\vhdl\lib\CPUs\JCpu\src\core\cpu.vhd"
-42
View File
@@ -1,42 +0,0 @@
#!/usr/bin/env ruby
str1 = %Q!lbl: dc "Hallo", ", ", 0, 1, " der","Jens"!
i=0;
def get_stri_lit (str)
res = [""];
state = "out"
j = 0;
k = 0;
for i in (0..str.length-1)
c = str[i];
nstate = state
case state
when "out"
if c == "\""[0]
nstate = "in"
end
when "in"
if c == "\""[0]
nstate = "out"
if j > 0
k = k + 1;
res[k] = ""
end
else
res[k] = res[k] + format("%c", c);
j = j + 1;
end
end
state = nstate
end;
return res
end
get_stri_lit(str1).each do |word|
puts word
end
-46
View File
@@ -1,46 +0,0 @@
#!/usr/bin/env ruby
# ----------------------------------------------------------------------
# Project: JCPU, a portable 8-bit RISC CPU written in VHDL
# This file: Insertion of code fragments into templates
#
# Copyright (C) 2007 J. Ahrensfeld
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# For questions and ideas, please contact the author at jens@jayfield.org
#
# ---------------------------------------------------------------------
arg = $*
rom_filename = arg[0].to_s
tpl_filename = arg[1].to_s
subst_pattern = "JASM_ROM_INSERT_HERE"
# --------------------------------------------------------
# Open file
# --------------------------------------------------------
romfile = File.open(rom_filename, "r")
tplfile = File.open(tpl_filename, "r")
re = Regexp.new(subst_pattern)
while (line = tplfile.gets)
puts line
line.scan(re).each do |word|
romfile.each do |raw_line|
puts raw_line
end
end
end
-32
View File
@@ -1,32 +0,0 @@
-------------------------------------------------------------------------
-- Project: JCPU, a portable 8-bit RISC CPU written in VHDL
-- This file: The ROM file for use in your VHDL design
--
-- Copyright (C) 2007 J. Ahrensfeld
--
-- This program is free software: you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
-- the Free Software Foundation, either version 3 of the License, or
-- (at your option) any later version.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU General Public License for more details.
--
-- You should have received a copy of the GNU General Public License
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
--
-- For questions and ideas, please contact the author at jens@jayfield.org
--
--------------------------------------------------------------------------
LIBRARY ieee;
use IEEE.STD_LOGIC_1164.ALL;
USE ieee.numeric_std.ALL;
library work;
use work.cpu_pkg.all;
-- JASM_ROM_INSERT_HERE
-151
View File
@@ -1,151 +0,0 @@
-------------------------------------------------------------------------
-- Project: JCPU, a portable 8-bit RISC CPU written in VHDL
-- This file: loadable ROM
--
-- Copyright (C) 2007 J. Ahrensfeld
--
-- This program is free software: you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
-- the Free Software Foundation, either version 3 of the License, or
-- (at your option) any later version.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU General Public License for more details.
--
-- You should have received a copy of the GNU General Public License
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
--
-- For questions and ideas, please contact the author at jens@jayfield.org
--
--------------------------------------------------------------------------
LIBRARY ieee;
use IEEE.STD_LOGIC_1164.ALL;
USE ieee.numeric_std.ALL;
library UNISIM;
use UNISIM.VComponents.all;
library work;
use work.cpu_pkg.all;
ENTITY irom IS
Port (
clk : in STD_LOGIC;
ce : in STD_LOGIC;
addr : in inst_addr_t;
dout : out inst_t
);
END irom;
ARCHITECTURE loadable OF irom IS
-- JASM_ROM_INSERT_HERE
signal jtag_ld_clk : STD_LOGIC;
signal jtag_ld_we : STD_LOGIC;
signal jtag_ld_addr : inst_addr_t;
signal jtag_ld_dout : inst_t;
signal jtag_ld_din : inst_t;
signal bs_rst, bs_sel, bs_shift, bs_tdi, bs_tdo : std_logic;
signal bs_capture, bs_clk0, bs_clk1, bs_update0, bs_update1 : std_logic;
signal user_regi, user_rego : unsigned (31 downto 0);
constant id : unsigned (31 downto 0) := X"BABE" & X"BEEF";
begin
--------------------------------------------------------------------------
-- Virtex-4: JTAG Loader
--------------------------------------------------------------------------
i00_BUFG : BUFG
port map
(
O => bs_clk1,
I => bs_clk0
);
i01_BUFG : BUFG
port map
(
O => bs_update1,
I => bs_update0
);
BSCAN_VIRTEX4_inst1 : BSCAN_VIRTEX4
generic map
(
JTAG_CHAIN => 1 -- Value to set BSCAN site of device. Possible values: (1,2,3 or 4)
)
port map
(
CAPTURE => bs_capture, -- CAPTURE output from TAP controller
DRCK => bs_clk0, -- Data register output for USER functions
RESET => bs_rst, -- Reset output from TAP controller
SEL => bs_sel, -- USER active output
SHIFT => bs_shift, -- SHIFT output from TAP controller
TDI => bs_tdi, -- TDI output from TAP controller
UPDATE => bs_update0, -- UPDATE output from TAP controller
TDO => bs_tdo -- Data input for USER function
);
jtag_ld_addr <= user_regi(user_regi'left downto user_regi'left-inst_addr_t'length+1);
jtag_ld_din <= user_regi(inst_t'length-1 downto 0);
jtag_ld_clk <= bs_update1;
jtag_ld_we <= bs_sel;
sipo:
process (bs_rst, bs_clk1, bs_tdi, bs_shift)
begin
if bs_rst = '1' then
user_regi <= (others => '0');
elsif rising_edge(bs_clk1) then
if bs_shift = '1' then
user_regi <= bs_tdi & user_regi(user_regi'left downto 1);
end if;
end if;
end process;
piso:
process (bs_rst, bs_clk1, bs_shift, user_rego)
begin
bs_tdo <= user_rego(0);
if bs_rst = '1' then
user_rego <= (others => '0');
elsif rising_edge(bs_clk1) then
if bs_shift = '1' then
user_rego <= user_rego(0) & user_rego(user_rego'left downto 1);
else
user_rego <= (user_rego'left downto inst_t'length => '0') & jtag_ld_dout;
-- user_rego <= id;
end if;
end if;
end process;
--------------------------------------------------------------------------
-- ROM Read/Write
--------------------------------------------------------------------------
PROM_READ:
process(clk, ce)
begin
if rising_edge(clk) and ce = '1' then
dout <= imem_rom(to_integer(addr));
end if;
end process;
PROM_WRITE:
process(jtag_ld_clk, jtag_ld_we)
begin
if rising_edge(jtag_ld_clk) then
if jtag_ld_we = '1' then
imem_rom(to_integer(jtag_ld_addr)) <= jtag_ld_din;
else
jtag_ld_dout <= imem_rom(to_integer(jtag_ld_addr));
end if;
end if;
end process;
--------------------------------------------------------------------------
end loadable;
-494
View File
@@ -1,494 +0,0 @@
#!/usr/bin/env ruby
# ----------------------------------------------------------------------
# Project: JCPU, a portable 8-bit RISC CPU written in VHDL
# This file: A small assembler for the JCPU
# Copyright (C) 2007 J. Ahrensfeld
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
# For questions and ideas, please contact the author at jens@jayfield.org
# ---------------------------------------------------------------------
arg = $*
MAX_SIZE_ROM = 1024
PROJECT_NAME = arg.to_s.gsub(/\..*/, "")
ENTITY_NAME = "rom"
ENTITY_DATA_TYPE = "inst_t"
ENTITY_ADDR_TYPE = "inst_addr_t"
OPC_LIST_NAME = "/cygdrive/w/vhdl/lib/CPUs/JCpu/tools/opc.list"
# --------------------------------------------------------
# Open file
# --------------------------------------------------------
filename = arg.to_s
if !File.exists?(filename)
STDERR.puts "#{filename} does not exist"
exit 1
end
# --------------------------------------------------------
# Pass 1
# --------------------------------------------------------
lc = 0 # Line counter
pc = 0 # Program counter
chip_dc = [0,0,0,0] # chip data counter
xmem_dc = 0 # xmem data counter
curr_segment = "UNDEF";
page = 0
label_list=[[],[]]
instr_list=[nil]
file = File.open(filename, "r")
file.each do |raw_line|
lc += 1
# Make all upper case
iline = "#{raw_line}".strip.upcase
# Remove comments
iline = iline.gsub(/;.*/, "")
# Split instruction at spaces
iline_member = iline.split(" ")
if iline_member[0] == nil
next
end
mc = 0;
label = nil
clean_line = nil
if (iline_member[0] =~ /\w+:/)
mc += 1
label = iline_member[0].delete(":")
if label_list.rindex(label) != nil
STDERR.puts format("Error in line %d: Duplicate label \"%s\" found", lc, label)
exit 1
end
end
case iline_member[mc]
when nil
value = format("0x%3.3X",pc)
when "EQU"
if 0 == (iline_member[mc+1] =~ /\d+/)
value = format("0x%2.2X",eval(iline_member[mc+1..iline_member.nitems].to_s))
else
value = iline_member[mc+1]
end
when "ORG", "CODE"
pc = eval(iline_member[mc+1..iline_member.nitems].to_s)
value = format("0x%3.3X",pc)
when "CDATA", "CMEM"
if iline_member[mc+1] == nil
STDERR.puts format("Error in line %d: CDATA needs argument!", lc)
exit 1
end
curr_segment = "CMEM";
page = iline_member[mc+1].to_i(16)
when "XDATA", "XMEM"
curr_segment = "XMEM";
when "DC"
len = 0;
iline.split("DC")[1].delete("0x").scan(/[0-9A-Fa-f]+/).each do |byte|
len += 1
end
if curr_segment == "CMEM"
STDERR.puts format("Error in line %d: CDATA cannot be initialized!", lc)
exit 1
else
value = format("0x%2.2X",xmem_dc)
puts format("Found DC defining %d bytes at 0x%4.4X in %s", len, xmem_dc, curr_segment);
xmem_dc += len
end
when "DB"
len = iline_member[mc+1].to_i
if curr_segment == "CMEM"
value = format("0x%2.2X",chip_dc[page])
puts format("Found DB reserving %d bytes at 0x%4.4X in %s(%d)", len, chip_dc[page], curr_segment, page);
chip_dc[page] += len
else
value = format("0x%2.2X",xmem_dc)
puts format("Found DB reserving %d bytes at 0x%4.4X in %s", len, xmem_dc, curr_segment);
xmem_dc += len
end
else
op_line = iline_member[mc+1..iline_member.nitems].to_s
value = format("0x%3.3X",pc)
opc = iline_member[mc]
if iline_member[mc+1] != nil
op1 = op_line.gsub(/,+.*$/, "")
end
if iline_member[mc+2] != nil
op2 = op_line.scan(/,.+$/).to_s.delete(", ")
end
if instr_list[pc] == nil
instr_list[pc] = [lc, pc, opc , op1 , op2]
pc += 1
else
STDERR.puts format("Error in line %d: Overlapping sections at %3.3X", lc, pc)
exit 1
end
end;
# Push labels
if label
label_list = label_list + [label, value]
end
end
file.close
# --------------------------------------------------------
def instr(opcode)
return format("\"%6.6B\" & X\"%3.3X\"",opcode ,0)
end
def tcl_bits(pc, opcode)
return format("%10.10B%6.6B%12.12B",pc, opcode ,0)
end
def instr_k(opcode, k)
return format("\"%6.6B\" & X\"%3.3X\"",opcode ,k)
end
def tcl_bits_k(pc, opcode, k)
return format("%10.10B%6.6B%12.12B",pc, opcode ,k)
end
def instr_r(opcode, r)
return format("\"%6.6B\" & X\"%2.2X%X\"",opcode ,0, r)
end
def tcl_bits_r(pc, opcode, r)
return format("%10.10B%6.6B%8.8B%4.4B",pc, opcode ,0,r)
end
def instr_kr(opcode, k, r)
return format("\"%6.6B\" & X\"%2.2X%X\"",opcode,k, r)
end
def tcl_bits_kr(pc, opcode, k, r)
return format("%10.10B%6.6B%8.8B%4.4B",pc, opcode, k, r)
end
def instr_rk(opcode, r, k)
return format("\"%6.6B\" & X\"%2.2X%X\"",opcode,k, r)
end
def tcl_bits_rk(pc, opcode, r, k)
return format("%10.10B%6.6B%8.8B%4.4B",pc, opcode, k, r)
end
def instr_rr(opcode, ra, rb)
return format("\"%6.6B\" & X\"%X%X%X\"",opcode,0, rb, ra)
end
def tcl_bits_rr(pc, opcode, ra, rb)
return format("%10.10B%6.6B%4.4B%4.4B%4.4B",pc, opcode, 0, rb, ra)
end
# --------------------------------------------------------
# Read mnemonic set
# --------------------------------------------------------
filename = OPC_LIST_NAME
if !File.exists?(filename)
STDERR.puts "#{filename} does not exist"
exit 1
end
mnemo_list = []
num_opcodes = 0
file = File.open(filename, "r")
file.each do |raw_line|
mnemo_list[num_opcodes] = raw_line.split(" ")[1]
num_opcodes += 1
end
# --------------------------------------------------------
# Pass 2
# --------------------------------------------------------
pc = 0
opc_start = 2
num_errors = 0
vhdl_trans_list = [nil]
vhdl_comment_list = [nil]
vhdl_tcl_list = [nil]
instr_list.each do |instruct|
# puts instruct
if instruct == nil
vhdl_trans_list[pc] = format("\"%6.6B\" & X\"%3.3X\"",0 ,0)
vhdl_comment_list[pc] = format("0x%3.3X:", pc)
vhdl_tcl_list[pc] = tcl_bits(pc, 0)
pc += 1
next
end
# determine arglen of instruction
ilen = 0
if instruct[opc_start+1] == nil
arglen = 0
elsif instruct[opc_start+2] == nil
arglen = 1
elsif instruct[opc_start+3] == nil
arglen = 2
end
# Symbol substitution
error = false
for i in (1..3)
subst_pos = opc_start+i
if instruct[subst_pos] == nil
next
end
expr_token = ""
expr_subst = nil
is_direct = true;
# instruct[subst_pos] = instruct[subst_pos].delete(" ")
# checks R0 .. R16, Mnemonics
instr_str = instruct[subst_pos]
if 0 == (instr_str =~ /\(.+\)/)
instr_str = instr_str.delete("()")
is_direct = false;
end
expr_token = instr_str.split(/\+|\-|\*|\//)[0]
if (0 != (expr_token =~ /R[0-9]+/)) && (0 != (expr_token =~ /\d+/))
idx = label_list.rindex(expr_token)
if idx != nil
expr_subst = label_list[idx+1]
instruct[subst_pos] = instruct[subst_pos].gsub(expr_token, expr_subst)
else
STDERR.puts format("Error in line %d: Symbol \"%s\" not found", instruct[0], expr_token)
error = true
end
end
if expr_subst != nil
if 0 == (expr_subst =~ /\d+/)
if is_direct == true
instruct[subst_pos] = format("0x%2.2X", eval(instruct[subst_pos]))
else
instruct[subst_pos] = format("(0x%2.2X)", eval(instruct[subst_pos]))
end
else
if 0 != (expr_subst =~ /R[0-9]+/)
STDERR.puts format("Error in line %d: Invalid expression \"%s\"", instruct[0], expr_subst)
error = true
end
end
end
end
# Parse operands
reg = [0,0]
kk = 0
format = instruct[opc_start]
for i in (0..1)
if instruct[opc_start+i+1] =~ Regexp.new("R[0-9]+")
# Check indirect addressing
reg[i] = instruct[opc_start+i+1].delete("R()").to_i
format += "|R"
if reg[i] > 15
STDERR.puts format("Error in line %d: Invalid register \"R%d\" specified", instruct[0], reg[i])
error = true
end
else
if instruct[opc_start+i+1] =~ Regexp.new("[0-9A-F]+")
kk = instruct[opc_start+i+1].delete("()").to_i(16)
format += "|K"
end
end
if instruct[opc_start+i+1] =~ Regexp.new("\\(.+\\)")
format += "i";
end
end
# Output instruction
opcode = mnemo_list.rindex(format).to_i
mnemo = instruct[2];
case format
when "NOP", "HALT", "RET", "RETI"
vhdl_trans_list[pc] = instr(opcode)
vhdl_tcl_list[pc] = tcl_bits(pc, opcode)
minstr_comment = format("0x%3.3X: %s", pc, mnemo)
when "MOVC|R|Ri", "MOVX|R|Ri"
vhdl_trans_list[pc] = instr_rr(opcode, reg[0], reg[1]);
vhdl_tcl_list[pc] = tcl_bits_rr(pc, opcode, reg[0], reg[1])
minstr_comment = format("0x%3.3X: %s R%2.2d, (R%2.2d)", pc, mnemo, reg[0], reg[1])
when "MOV|R|R", "SUB|R|R", "ADD|R|R", "AND|R|R", "OR|R|R", "XOR|R|R", "CMP|R|R"
vhdl_trans_list[pc] = instr_rr(opcode, reg[0], reg[1]);
vhdl_tcl_list[pc] = tcl_bits_rr(pc, opcode, reg[0], reg[1])
minstr_comment = format("0x%3.3X: %s R%2.2d, R%2.2d", pc, mnemo, reg[0], reg[1])
when "MOVC|Ri|R", "MOVX|Ri|R"
vhdl_trans_list[pc] = instr_rr(opcode, reg[1], reg[0]);
vhdl_tcl_list[pc] = tcl_bits_rr(pc, opcode, reg[1], reg[0])
minstr_comment = format("0x%3.3X: %s (R%2.2d), R%2.2d", pc, mnemo, reg[1], reg[0])
when "MOVC|Ri|K", "MOVX|Ri|K", "COUT|Ri|K", "XOUT|Ri|K"
vhdl_trans_list[pc] = instr_rk(opcode, reg[0], kk);
vhdl_tcl_list[pc] = tcl_bits_rk(pc, opcode, reg[0], kk)
minstr_comment = format("0x%3.3X: %s (R%2.2d), 0x%2.2X", pc, mnemo, reg[0], kk)
when "MOVC|R|Ki", "MOVX|R|Ki", "CIN|R|Ki", "XIN|R|Ki"
vhdl_trans_list[pc] = instr_rk(opcode, reg[0], kk);
vhdl_tcl_list[pc] = tcl_bits_rk(pc, opcode, reg[0], kk)
minstr_comment = format("0x%3.3X: %s R%2.2d, (0x%2.2X)", pc, mnemo, reg[0], kk)
when "MOV|R|K", "SUB|R|K", "ADD|R|K", "AND|R|K", "OR|R|K", "XOR|R|K", "CMP|R|K"
vhdl_trans_list[pc] = instr_rk(opcode, reg[0], kk);
vhdl_tcl_list[pc] = tcl_bits_rk(pc, opcode, reg[0], kk)
minstr_comment = format("0x%3.3X: %s R%2.2d, 0x%2.2X", pc, mnemo, reg[0], kk)
when "MOVC|Ki|R", "MOVC|Ki|R", "MOVX|Ki|R", "MOVX|Ki|R", "COUT|Ki|R", "XOUT|Ki|R"
vhdl_trans_list[pc] = instr_kr(opcode, kk, reg[1]);
vhdl_tcl_list[pc] = tcl_bits_kr(pc, opcode, kk, reg[1])
minstr_comment = format("0x%3.3X: %s (0x%2.2X), R%2.2d", pc, mnemo, kk, reg[1])
when "CALL|K", "JMP|K", "JNZ|K", "JZ|K","JNC|K", "JC|K", "JLT|K", "JGT|K", "JLE|K", "JGE|K", "JEQ|K", "JNE|K"
vhdl_trans_list[pc] = instr_k(opcode, kk)
vhdl_tcl_list[pc] = tcl_bits_k(pc, opcode, kk)
minstr_comment = format("0x%3.3X: %s 0x%3.3X", pc, mnemo, kk)
when "PUSH|R", "POP|R", "SHR|R", "SHL|R", "ROR|R", "ROL|R", "RORC|R", "ROLC|R"
vhdl_trans_list[pc] = instr_r(opcode, reg[0])
vhdl_tcl_list[pc] = tcl_bits_r(pc, opcode, reg[0])
minstr_comment = format("0x%3.3X: %s R%2.2d", pc, mnemo, reg[0])
when "TST|R"
kk = 0
minstr_comment = format("0x%3.3X: %s R%2.2d", pc, mnemo, reg[0])
opcode = mnemo_list.rindex("CMP|R|K").to_i
vhdl_trans_list[pc] = instr_rk(opcode, reg[0], kk);
vhdl_tcl_list[pc] = tcl_bits_rk(pc, opcode, reg[0], kk)
when "INC|R"
kk = 1
minstr_comment = format("0x%3.3X: %s R%2.2d", pc, mnemo, reg[0])
opcode = mnemo_list.rindex("ADD|R|K").to_i
vhdl_trans_list[pc] = instr_rk(opcode, reg[0], kk);
vhdl_tcl_list[pc] = tcl_bits_rk(pc, opcode, reg[0], kk)
when "DEC|R"
kk = 1
minstr_comment = format("0x%3.3X: %s R%2.2d", pc, mnemo, reg[0])
opcode = mnemo_list.rindex("SUB|R|K").to_i
vhdl_trans_list[pc] = instr_rk(opcode, reg[0], kk);
vhdl_tcl_list[pc] = tcl_bits_rk(pc, opcode, reg[0], kk)
else
STDERR.puts format("Error in line %d: Not yet implemented %s", instruct[0], format)
error = true
end
if error
num_errors += 1
break
end
vhdl_comment_list[pc] = minstr_comment
puts vhdl_trans_list[pc] + " -- " + minstr_comment
pc += 1
end
# --------------------------------------------------------
# Output ROM file
# --------------------------------------------------------
if num_errors == 0
filename = format("rom_%s.vhdl.snip", PROJECT_NAME)
file = File.open(filename, "w")
file.puts format("ENTITY %s IS\n", ENTITY_NAME)
file.puts format("\tPort (\n")
file.puts format("\tclk\t\t\t: in STD_LOGIC;\n")
file.puts format("\tce\t\t\t: in STD_LOGIC;\n")
file.puts format("\taddr\t\t: in %s;\n", ENTITY_ADDR_TYPE)
file.puts format("\tdout\t\t: out %s\n", ENTITY_DATA_TYPE)
file.puts format("\t);\n")
file.puts format("END %s;\n", ENTITY_NAME)
file.puts format("\n")
file.puts format("ARCHITECTURE %s OF %s IS \n", PROJECT_NAME, ENTITY_NAME)
file.puts format("\n")
file.puts format("\ttype instruction_rom_t is array (0 to %d) of %s;\n", pc-1, ENTITY_DATA_TYPE)
file.puts format("\n")
file.puts format("\tconstant instruction_rom : instruction_rom_t :=\n")
file.puts format("\t(\n");
for i in (0..pc-2)
file.puts "\t\t" + vhdl_trans_list[i] + ", -- " + vhdl_comment_list[i] + "\n"
end;
file.puts "\t\t" + vhdl_trans_list[pc-1] + " -- " + vhdl_comment_list[pc-1] + "\n"
file.puts format("\t);\n")
file.puts format("\n")
file.puts format("begin")
file.puts format("\n")
file.puts format("PROM_READ:")
file.puts format("\tprocess(clk, ce)\n")
file.puts format("\tbegin\n")
file.puts format("\t\tif rising_edge(clk) and ce = '1' then\n")
file.puts format("\t\t\tdout <= instruction_rom(to_integer(addr));\n")
file.puts format("\t\tend if;\n")
file.puts format("\tend process;\n")
file.puts format("\n")
file.puts format("end %s;\n", PROJECT_NAME)
puts format("ROM file written to \"%s\"\n",filename)
file.close
end
if num_errors == 0
filename = format("preinit_%s.vhdl.snip", PROJECT_NAME)
file = File.open(filename, "w")
file.puts format("\tsignal instruction_rom : instruction_rom_t :=\n")
file.puts format("\t(\n");
for i in (0..pc-2)
file.puts "\t\t" + vhdl_trans_list[i] + ", -- " + vhdl_comment_list[i] + "\n"
end;
if pc < (MAX_SIZE_ROM-1)
file.puts "\t\t" + vhdl_trans_list[pc-1] + ", -- " + vhdl_comment_list[pc-1] + "\n"
for i in (pc..(MAX_SIZE_ROM-2))
file.puts "\t\t" + instr(0) + ",\n"
end;
file.puts "\t\t" + instr(0) + "\n"
else
file.puts "\t\t" + vhdl_trans_list[pc-1] + " -- " + vhdl_comment_list[pc-1] + "\n"
end
file.puts format("\t);\n")
puts format("PREINIT file written to \"%s\"\n",filename)
file.close
end
if num_errors == 0
filename = format("rom_%s.tcl.snip", PROJECT_NAME)
file = File.open(filename, "w")
for i in (0..pc-1)
# Chipscope 8.1
# file.puts format("jtag_shiftdr $handle -buffer \"%s\" -endstate RTI -device $devid", vhdl_tcl_list[i].reverse);
# Chipscope 9.1
file.puts format("\# %s", vhdl_comment_list[i])
file.puts format("::chipscope::csejtag_tap shift_device_dr $handle $devid $CSEJTAG_SHIFT_READWRITE $CSEJTAG_RUN_TEST_IDLE 0 %d \"%8.8X\"\n\n", vhdl_tcl_list[i].length, vhdl_tcl_list[i].to_i(2));
end;
puts format("TCL snippet written to \"%s\"\n",filename)
file.close
end
# --------------------------------------------------------
# Output final statistics
# --------------------------------------------------------
if num_errors == 0
puts "Program uses #{pc} instruction addresses"
puts "No errors found"
exit 0
else
puts "#{num_errors} errors found"
exit 1
end
-814
View File
@@ -1,814 +0,0 @@
#!/usr/bin/env ruby
# ----------------------------------------------------------------------
# Project: JCPU, a portable 8-bit RISC CPU written in VHDL
# This file: A small assembler for the JCPU
#
# Copyright (C) 2007 J. Ahrensfeld
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# For questions and ideas, please contact the author at jens@jayfield.org
#
# ---------------------------------------------------------------------
arg = $*
FILE_SUFFIX = "jsm"
IROM_MAX_SIZE = 1024
IROM_ENTITY_NAME = "irom"
IROM_DATA_TYPE = "inst_t"
IROM_ADDR_TYPE = "inst_addr_t"
XROM_MAX_SIZE = 256
XROM_DATA_TYPE = "dmem_data_t"
XROM_ADDR_TYPE = "dmem_addr_t"
XROM_ENTITY_NAME = "xrom"
OPC_LIST_NAME = "/cygdrive/w/vhdl/lib/CPUs/JCpu/tools/opc.list"
# --------------------------------------------------------
class Parser
def curr_segment
@curr_segment
end
def curr_segment=(arg)
@curr_segment=arg
end
def add_label(labelname, addr)
@label_list = @label_list + [labelname, addr]
end
def getLabelIdByName(label)
return @label_list.rindex(label)
end
def getLabelNameById(id)
return @label_list[id]
end
def put_instr(name, lc, opc , op1 , op2)
if get_instr != nil
STDERR.puts format("Error in line %d: Overlapping sections at %3.3X", lc, @pc)
exit 1
end
@instr_list[@pc] = [lc, @pc, opc , op1 , op2, name]
end
def get_instr
return @instr_list[@pc]
end
def put_xmem(value, lc)
if get_xmem != nil
STDERR.puts format("Error in line %d: Overlapping sections at %3.3X (%s)", lc, xmem_dc, curr_segment)
exit 1
end
@xmem[xmem_dc] = value
@xmem_dc = xmem_dc + 1
end
def get_xmem
return @xmem[xmem_dc]
end
def xmem
return @xmem
end
def put_cmem(value, lc)
if get_cmem(page) != nil
STDERR.puts format("Error in line %d: Overlapping sections at %3.3X (%s)", lc, cmem_dc, curr_segment)
exit 1
end
@cmem[page][cmem_dc] = value
@cmem_dc[page] = cmem_dc + 1
end
def get_cmem(pg)
return @cmem[pg][cmem_dc]
end
def cmem(page)
return @cmem[page]
end
def cmem_dc=(addr)
@cmem_dc[page] = addr
end
def cmem_dc
@cmem_dc[page]
end
def xmem_dc=(addr)
@xmem_dc = addr
end
def xmem_dc
@xmem_dc
end
def page=(page)
@page = page;
end
def page
@page;
end
def pc=(pc)
@pc = pc;
if (pc > @pc_max)
@pc_max = pc
end
end
def pc
@pc;
end
def pc_max
@pc_max;
end
def instr_list
@instr_list
end
def label_list
@label_list
end
def initialize()
@pc_max = 0
@pc = 0 # Program counter
@cmem_dc = [0,0,0,0] # chip data counter
@xmem_dc = 0 # xmem data counter
@curr_segment = "UNDEF";
@page = 0
@label_list=[[],[]]
@instr_list=[nil]
@cmem = [[],[]];
@xmem = [];
end
def method_missing(name, *args)
puts "I don't know the method #{name}"
end
end
# --------------------------------------------------------
def parse(name, obj)
lc = 0 # Line counter
file = File.open(name, "r")
file.each do |raw_line|
lc += 1
# Make all upper case
iline = "#{raw_line}".strip
# Remove comments
iline = iline.gsub(/;.*/, "")
# Split instruction at spaces
iline_member = iline.split(" ")
if iline_member[0] == nil
next
end
mc = 0;
label = nil
clean_line = nil
if (iline_member[0] =~ /\w+:/)
mc += 1
label = iline_member[0].delete(":")
if obj.getLabelIdByName(label) != nil
STDERR.puts format("Error in line %d: Duplicate label \"%s\" found", lc, label)
exit 1
end
end
token = iline_member[mc]
if token
token = token.upcase
end
case token
when nil
if obj.curr_segment == "CMEM"
curr_addr = format("0x%3.3X",obj.cmem_dc)
elsif obj.curr_segment == "XMEM"
curr_addr = format("0x%3.3X",obj.xmem_dc)
elsif obj.curr_segment == "CODE"
curr_addr = format("0x%3.3X",obj.pc)
else
STDERR.puts format("Error in line %d: Undefined segment", lc)
exit 1
end
when "INCLUDE"
if iline_member[mc+1] == nil
STDERR.puts format("Error in line %d: %s needs argument!", lc, token)
exit 1
end
inc_name = iline_member[mc+1].delete("\"")
puts format("Inserting \"%s\" into \"%s\" at line %d", inc_name, name, lc);
parse(inc_name, obj)
when "EQU"
if iline_member[mc+1] == nil
STDERR.puts format("Error in line %d: %s needs argument!", lc, token)
exit 1
end
if 0 == (iline_member[mc+1] =~ /\d+/)
curr_addr = format("0x%2.2X",eval(iline_member[mc+1..iline_member.nitems].to_s))
else
curr_addr = iline_member[mc+1]
end
when "ORG"
if iline_member[mc+1] == nil
STDERR.puts format("Error in line %d: %s needs argument!", lc, token)
exit 1
end
offset = eval(iline_member[mc+1..iline_member.nitems].to_s)
case obj.curr_segment
when "CODE"
obj.pc = offset
curr_addr = format("0x%3.3X",obj.pc)
when "CMEM"
obj.cmem_dc = offset
when "XMEM"
obj.xmem_dc = offset
end
when "CODE"
curr_addr = format("0x%3.3X",obj.pc)
obj.curr_segment = "CODE";
when "CDATA", "CMEM"
if iline_member[mc+1] == nil
STDERR.puts format("Error in line %d: %s needs argument!", lc, token)
exit 1
end
obj.curr_segment = "CMEM";
obj.page = iline_member[mc+1].to_i(16)
when "XDATA", "XMEM"
obj.curr_segment = "XMEM";
when "DC"
len = 0;
if iline_member[mc+1] == nil
STDERR.puts format("Error in line %d: %s needs argument!", lc, token)
exit 1
end
if obj.curr_segment == "CMEM"
STDERR.puts format("Error in line %d: %s cannot be initialized!", lc, obj.curr_segment)
exit 1
elsif obj.curr_segment == "XMEM"
curr_addr = format("0x%2.2X",obj.xmem_dc)
dc_old = obj.xmem_dc;
val_array = raw_line.split(/dc|DC|Dc|dC/)[1].delete("\t").gsub(/;.*/, "").split(",")
# Parse string literals
val_array.each do |item|
if 0 == (item =~ /.*\".*\"/)
str = item.delete("\"")
puts item
for nn in (0..str.length-1)
if str[nn] > 31
obj.put_xmem(str[nn], lc);
puts "S: " + str[nn].to_s
len += 1
end
end;
else
argument = item
puts "B: " + argument
obj.put_xmem(eval(argument), lc);
len += 1
end
end
puts format("Found DC defining %d bytes at 0x%4.4X in %s", len, dc_old, obj.curr_segment);
else
STDERR.puts format("Error in line %d: Invalid segment %s for \"%s\"", lc, obj.curr_segment, token)
exit 1
end
when "DB"
if iline_member[mc+1] == nil
STDERR.puts format("Error in line %d: %s needs argument!", lc, token)
exit 1
end
len = eval(iline_member[mc+1]).to_i
if obj.curr_segment == "CMEM"
curr_addr = format("0x%2.2X",obj.cmem_dc)
puts format("Found DB reserving %d bytes at 0x%4.4X in %s(%d)", len, obj.cmem_dc, obj.curr_segment, obj.page);
for nn in (1..len)
obj.put_cmem(0, lc)
end
elsif obj.curr_segment == "XMEM"
curr_addr = format("0x%2.2X",obj.xmem_dc)
puts format("Found DB reserving %d bytes at 0x%4.4X in %s", len, obj.xmem_dc, obj.curr_segment);
for nn in (1..len)
obj.put_xmem(0, lc)
end
else
STDERR.puts format("Error in line %d: Invalid segment %s for \"%s\"", lc, obj.curr_segment, token)
exit 1
end
else
if obj.curr_segment != "CODE"
STDERR.puts format("Error in line %d: Invalid segment %s for \"%s\"", lc, obj.curr_segment, token)
exit 1
end
op_line = iline_member[mc+1..iline_member.nitems].to_s
curr_addr = format("0x%3.3X",obj.pc)
opc = token
if iline_member[mc+1] != nil
op1 = op_line.gsub(/,+.*$/, "")
end
if iline_member[mc+2] != nil
op2 = op_line.scan(/,.+$/).to_s.delete(", ")
end
obj.put_instr(name, lc, opc, op1, op2)
obj.pc = obj.pc + 1
end;
# Push labels
if label
obj.add_label(label, curr_addr)
end
end
file.close
return obj
end
# --------------------------------------------------------
# Instruction formatting
# --------------------------------------------------------
def instr(opcode)
return format("\"%6.6B\" & X\"%3.3X\"",opcode ,0)
end
def tcl_bits(pc, opcode)
return format("%12.12B%8.8B%12.12B",pc, opcode ,0)
end
def instr_k(opcode, k)
return format("\"%6.6B\" & X\"%3.3X\"",opcode ,k)
end
def tcl_bits_k(pc, opcode, k)
return format("%12.12B%8.8B%12.12B",pc, opcode ,k)
end
def instr_r(opcode, r)
return format("\"%6.6B\" & X\"%2.2X%X\"",opcode ,0, r)
end
def tcl_bits_r(pc, opcode, r)
return format("%12.12B%8.8B%8.8B%4.4B",pc, opcode ,0,r)
end
def instr_kr(opcode, k, r)
return format("\"%6.6B\" & X\"%2.2X%X\"",opcode,k, r)
end
def tcl_bits_kr(pc, opcode, k, r)
return format("%12.12B%8.8B%8.8B%4.4B",pc, opcode, k, r)
end
def instr_rk(opcode, r, k)
return format("\"%6.6B\" & X\"%2.2X%X\"",opcode,k, r)
end
def tcl_bits_rk(pc, opcode, r, k)
return format("%12.12B%8.8B%8.8B%4.4B",pc, opcode, k, r)
end
def instr_rr(opcode, ra, rb)
return format("\"%6.6B\" & X\"%X%X%X\"",opcode,0, rb, ra)
end
def tcl_bits_rr(pc, opcode, ra, rb)
return format("%12.12B%8.8B%4.4B%4.4B%4.4B",pc, opcode, 0, rb, ra)
end
# --------------------------------------------------------
# Open file
# --------------------------------------------------------
filename = arg.to_s
if !File.exists?(filename)
STDERR.puts "#{filename} does not exist"
exit 1
end
PROJECT_NAME = File.basename(filename, "." + FILE_SUFFIX)
# --------------------------------------------------------
# Pass 1
# --------------------------------------------------------
first_pass = Parser.new();
parse(filename, first_pass)
# --------------------------------------------------------
# Read mnemonic set
# --------------------------------------------------------
filename = OPC_LIST_NAME
if !File.exists?(filename)
STDERR.puts "#{filename} does not exist"
exit 1
end
mnemo_list = []
num_opcodes = 0
file = File.open(filename, "r")
file.each do |raw_line|
mnemo_list[num_opcodes] = raw_line.split(" ")[1]
num_opcodes += 1
end
# --------------------------------------------------------
# Pass 2
# --------------------------------------------------------
pc = 0
opc_start = 2
num_errors = 0
vhdl_trans_list = [nil]
vhdl_comment_list = [nil]
vhdl_tcl_list = [nil]
# ToDo: Use class-methods
label_list = first_pass.label_list
instr_list = first_pass.instr_list
instr_list.each do |instruct|
# puts instruct
if instruct == nil
vhdl_trans_list[pc] = format("\"%6.6B\" & X\"%3.3X\"",0 ,0)
vhdl_comment_list[pc] = format("0x%3.3X:", pc)
vhdl_tcl_list[pc] = tcl_bits(pc, 0)
pc += 1
next
end
# determine arglen of instruction
ilen = 0
if instruct[opc_start+1] == nil
arglen = 0
elsif instruct[opc_start+2] == nil
arglen = 1
elsif instruct[opc_start+3] == nil
arglen = 2
end
# Symbol substitution
error = false
for i in (1..2)
subst_pos = opc_start+i
if instruct[subst_pos] == nil
next
end
expr_token = ""
expr_subst = nil
is_direct = true;
# checks R0 .. R16, Mnemonics
instruct[subst_pos] = instruct[subst_pos].gsub(/'low/, "")
if (nil != (instruct[subst_pos] =~ /'high/))
instruct[subst_pos]= format("%s/256", instruct[subst_pos].gsub(/'high/, ""))
end
instr_str = instruct[subst_pos]
if 0 == (instr_str =~ /\(.+\)/)
instr_str = instr_str.delete("()")
is_direct = false;
end
expr_token = instr_str.split(/\+|\-|\*|\/|\||\&/)[0]
if (0 != (expr_token =~ /R[0-9]+/)) && (0 != (expr_token =~ /\d+/))
idx = label_list.rindex(expr_token)
if idx != nil
expr_subst = label_list[idx+1]
instruct[subst_pos] = instruct[subst_pos].gsub(expr_token, expr_subst)
else
STDERR.puts format("%s: Error in line %d: Symbol \"%s\" not found", instruct[5], instruct[0], expr_token)
error = true
end
end
if expr_subst != nil
if 0 == (expr_subst =~ /\d+/)
if is_direct == true
instruct[subst_pos] = format("0x%2.2X", eval(instruct[subst_pos]))
else
instruct[subst_pos] = format("(0x%2.2X)", eval(instruct[subst_pos]))
end
else
if 0 != (expr_subst =~ /R[0-9]+/)
STDERR.puts format("%s: Error in line %d: Invalid expression \"%s\"", instruct[5], instruct[0], expr_subst)
error = true
end
end
end
end
# Parse operands
reg = [0,0]
kk = 0
format = instruct[opc_start]
for i in (0..1)
if instruct[opc_start+i+1] =~ Regexp.new("R[0-9]+")
# Check indirect addressing
reg[i] = instruct[opc_start+i+1].delete("R()").to_i
format += "|R"
if reg[i] > 15
STDERR.puts format("%s: Error in line %d: Invalid register \"R%d\" specified", instruct[5], instruct[0], reg[i])
error = true
end
else
if instruct[opc_start+i+1] =~ Regexp.new("[0-9A-F]+")
kk = eval(instruct[opc_start+i+1].delete("()"))
format += "|K"
end
end
if instruct[opc_start+i+1] =~ Regexp.new("\\(.+\\)")
format += "i";
end
end
if error
num_errors += 1
break
end
# Output instruction
opcode = mnemo_list.rindex(format).to_i
mnemo = instruct[2];
case format
# Native instructions
when "NOP", "HALT", "RET", "RETI", "SETC"
vhdl_trans_list[pc] = instr(opcode)
vhdl_tcl_list[pc] = tcl_bits(pc, opcode)
minstr_comment = format("0x%3.3X: %s", pc, mnemo)
when "MOVC|R|Ri", "MOVX|R|Ri"
vhdl_trans_list[pc] = instr_rr(opcode, reg[0], reg[1]);
vhdl_tcl_list[pc] = tcl_bits_rr(pc, opcode, reg[0], reg[1])
minstr_comment = format("0x%3.3X: %s R%2.2d, (R%2.2d)", pc, mnemo, reg[0], reg[1])
when "MOV|R|R", "SUB|R|R", "SUBC|R|R", "ADD|R|R", "ADDC|R|R", "AND|R|R", "OR|R|R", "XOR|R|R", "CMP|R|R"
vhdl_trans_list[pc] = instr_rr(opcode, reg[0], reg[1]);
vhdl_tcl_list[pc] = tcl_bits_rr(pc, opcode, reg[0], reg[1])
minstr_comment = format("0x%3.3X: %s R%2.2d, R%2.2d", pc, mnemo, reg[0], reg[1])
when "MOVC|Ri|R", "MOVX|Ri|R"
vhdl_trans_list[pc] = instr_rr(opcode, reg[1], reg[0]);
vhdl_tcl_list[pc] = tcl_bits_rr(pc, opcode, reg[1], reg[0])
minstr_comment = format("0x%3.3X: %s (R%2.2d), R%2.2d", pc, mnemo, reg[1], reg[0])
when "MOVC|Ri|K", "MOVX|Ri|K", "COUT|Ri|K", "XOUT|Ri|K"
kk = kk % 256;
vhdl_trans_list[pc] = instr_rk(opcode, reg[0], kk);
vhdl_tcl_list[pc] = tcl_bits_rk(pc, opcode, reg[0], kk)
minstr_comment = format("0x%3.3X: %s (R%2.2d), 0x%2.2X", pc, mnemo, reg[0], kk)
when "MOVC|R|Ki", "MOVX|R|Ki", "CIN|R|Ki", "XIN|R|Ki"
vhdl_trans_list[pc] = instr_rk(opcode, reg[0], kk);
vhdl_tcl_list[pc] = tcl_bits_rk(pc, opcode, reg[0], kk)
minstr_comment = format("0x%3.3X: %s R%2.2d, (0x%2.2X)", pc, mnemo, reg[0], kk)
when "MOV|R|K", "SUB|R|K", "SUBC|R|K", "ADD|R|K", "ADDC|R|K", "AND|R|K", "OR|R|K", "XOR|R|K", "CMP|R|K"
kk = kk % 256;
vhdl_trans_list[pc] = instr_rk(opcode, reg[0], kk);
vhdl_tcl_list[pc] = tcl_bits_rk(pc, opcode, reg[0], kk)
minstr_comment = format("0x%3.3X: %s R%2.2d, 0x%2.2X", pc, mnemo, reg[0], kk)
when "SUB|K|R", "SUBC|K|R"
kk = kk % 256;
vhdl_trans_list[pc] = instr_kr(opcode, kk, reg[1]);
vhdl_tcl_list[pc] = tcl_bits_kr(pc, opcode, kk, reg[1])
minstr_comment = format("0x%3.3X: %s 0x%2.2d, R%2.2X", pc, mnemo, kk, reg[1])
when "MOVC|Ki|R", "MOVC|Ki|R", "MOVX|Ki|R", "MOVX|Ki|R", "COUT|Ki|R", "XOUT|Ki|R"
vhdl_trans_list[pc] = instr_kr(opcode, kk, reg[1]);
vhdl_tcl_list[pc] = tcl_bits_kr(pc, opcode, kk, reg[1])
minstr_comment = format("0x%3.3X: %s (0x%2.2X), R%2.2d", pc, mnemo, kk, reg[1])
when "CALL|K", "JMP|K", "JNZ|K", "JZ|K","JNC|K", "JC|K", "JLT|K", "JGT|K", "JLE|K", "JGE|K", "JEQ|K", "JNE|K"
vhdl_trans_list[pc] = instr_k(opcode, kk)
vhdl_tcl_list[pc] = tcl_bits_k(pc, opcode, kk)
minstr_comment = format("0x%3.3X: %s 0x%3.3X", pc, mnemo, kk)
when "PUSH|R", "POP|R", "SHR|R", "SHL|R", "ROR|R", "ROL|R", "RORC|R", "ROLC|R", "SWAP|R"
vhdl_trans_list[pc] = instr_r(opcode, reg[0])
vhdl_tcl_list[pc] = tcl_bits_r(pc, opcode, reg[0])
minstr_comment = format("0x%3.3X: %s R%2.2d", pc, mnemo, reg[0])
# Synthetic instructions
when "CLRC"
kk = 0;
minstr_comment = format("0x%3.3X: %s", pc, mnemo)
opcode = mnemo_list.rindex("SUB|R|K").to_i
vhdl_trans_list[pc] = instr_rk(opcode, reg[0], kk);
vhdl_tcl_list[pc] = tcl_bits_rk(pc, opcode, reg[0], kk)
when "TST|R"
kk = 0
minstr_comment = format("0x%3.3X: %s R%2.2d", pc, mnemo, reg[0])
opcode = mnemo_list.rindex("CMP|R|K").to_i
vhdl_trans_list[pc] = instr_rk(opcode, reg[0], kk);
vhdl_tcl_list[pc] = tcl_bits_rk(pc, opcode, reg[0], kk)
when "NEG|R"
kk = 0
minstr_comment = format("0x%3.3X: %s R%2.2d", pc, mnemo, reg[0])
opcode = mnemo_list.rindex("SUB|K|R").to_i
vhdl_trans_list[pc] = instr_rk(opcode, reg[0], kk);
vhdl_tcl_list[pc] = tcl_bits_rk(pc, opcode, reg[0], kk)
when "NOT|R"
kk = 0
minstr_comment = format("0x%3.3X: %s R%2.2d", pc, mnemo, reg[0])
opcode = mnemo_list.rindex("XOR|R|K").to_i
vhdl_trans_list[pc] = instr_rk(opcode, reg[0], kk);
vhdl_tcl_list[pc] = tcl_bits_rk(pc, opcode, reg[0], kk)
when "INC|R"
kk = 1
minstr_comment = format("0x%3.3X: %s R%2.2d", pc, mnemo, reg[0])
opcode = mnemo_list.rindex("ADD|R|K").to_i
vhdl_trans_list[pc] = instr_rk(opcode, reg[0], kk);
vhdl_tcl_list[pc] = tcl_bits_rk(pc, opcode, reg[0], kk)
when "DEC|R"
kk = 1
minstr_comment = format("0x%3.3X: %s R%2.2d", pc, mnemo, reg[0])
opcode = mnemo_list.rindex("SUB|R|K").to_i
vhdl_trans_list[pc] = instr_rk(opcode, reg[0], kk);
vhdl_tcl_list[pc] = tcl_bits_rk(pc, opcode, reg[0], kk)
else
STDERR.puts format("%s: Error in line %d: Not yet implemented %s", instruct[5], instruct[0], format)
error = true
end
if error
num_errors += 1
break
end
vhdl_comment_list[pc] = minstr_comment
puts vhdl_trans_list[pc] + " -- " + minstr_comment
pc += 1
end
# --------------------------------------------------------
# Output ROM file
# --------------------------------------------------------
if num_errors == 0
# I-ROM VHDL-ROM
filename = format("%s.irom.vhdl.snip", PROJECT_NAME)
file = File.open(filename, "w")
file.puts format("ENTITY %s IS\n", IROM_ENTITY_NAME)
file.puts format("\tPort (\n")
file.puts format("\tclk\t\t\t: in STD_LOGIC;\n")
file.puts format("\tce\t\t\t: in STD_LOGIC;\n")
file.puts format("\taddr\t\t: in %s;\n", IROM_ADDR_TYPE)
file.puts format("\tdout\t\t: out %s\n", IROM_DATA_TYPE)
file.puts format("\t);\n")
file.puts format("END %s;\n", IROM_ENTITY_NAME)
file.puts format("\n")
file.puts format("ARCHITECTURE %s OF %s IS \n", PROJECT_NAME, IROM_ENTITY_NAME)
file.puts format("\n")
file.puts format("\ttype imem_rom_t is array (0 to %d) of %s;\n", [IROM_MAX_SIZE, pc].min-1 , IROM_DATA_TYPE)
file.puts format("\n")
file.puts format("\t-- Assembled from %s.%s", PROJECT_NAME, FILE_SUFFIX)
file.puts format("\tconstant imem_rom : imem_rom_t :=\n")
file.puts format("\t(\n");
for i in (0..[IROM_MAX_SIZE, pc].min-2)
file.puts "\t\t" + vhdl_trans_list[i] + ", -- " + vhdl_comment_list[i] + "\n"
end;
file.puts "\t\t" + vhdl_trans_list[pc-1] + " -- " + vhdl_comment_list[pc-1] + "\n"
file.puts format("\t);\n")
file.puts format("\n")
file.puts format("begin")
file.puts format("\n")
file.puts format("PROM_READ:")
file.puts format("\tprocess(clk, ce)\n")
file.puts format("\tbegin\n")
file.puts format("\t\tif rising_edge(clk) and ce = '1' then\n")
file.puts format("\t\t\tdout <= imem_rom(to_integer(addr));\n")
file.puts format("\t\tend if;\n")
file.puts format("\tend process;\n")
file.puts format("\n")
file.puts format("end %s;\n", PROJECT_NAME)
puts format("I-ROM file written to \"%s\"\n",filename)
file.close
# I-ROM VHDL-ROM (loadable)
filename = format("%s.irom_ld.vhdl.snip", PROJECT_NAME)
file = File.open(filename, "w")
file.puts format("\n\t-- Assembled from %s.%s", PROJECT_NAME, FILE_SUFFIX)
file.puts format("\ttype imem_rom_t is array (0 to %d) of %s;\n", IROM_MAX_SIZE-1, IROM_DATA_TYPE)
file.puts format("\tsignal imem_rom : imem_rom_t :=\n")
file.puts format("\t(\n");
for i in (0..pc-2)
file.puts "\t\t" + vhdl_trans_list[i] + ", -- " + vhdl_comment_list[i] + "\n"
end;
if pc < (IROM_MAX_SIZE-1)
file.puts "\t\t" + vhdl_trans_list[pc-1] + ", -- " + vhdl_comment_list[pc-1] + "\n"
for i in (pc..(IROM_MAX_SIZE-2))
file.puts "\t\t" + instr(0) + ",\n"
end;
file.puts "\t\t" + instr(0) + "\n"
else
file.puts "\t\t" + vhdl_trans_list[pc-1] + " -- " + vhdl_comment_list[pc-1] + "\n"
end
file.puts format("\t);\n")
puts format("I-ROM (loadable) file written to \"%s\"\n",filename)
file.close
# I-ROM TCL-Loader
filename = format("%s.irom.tcl.snip", PROJECT_NAME)
file = File.open(filename, "w")
file.puts format("# Assembled from %s.%s", PROJECT_NAME, FILE_SUFFIX)
file.puts format("# ---------------------------------------------------------------");
file.puts format("# Shift the USER1 Instruction (b1111000010) into the Instruction Register of FPGA");
file.puts format("# User 1")
file.puts format("set result [::chipscope::csejtag_tap shift_device_ir $handle $devid $CSE_OP $CSE_ES 0 $irlength \"3C2\"]\n\n")
for i in (0..pc-1)
# Chipscope 8.1
# file.puts format("jtag_shiftdr $handle -buffer \"%s\" -endstate RTI -device $devid", vhdl_tcl_list[i].reverse);
# Chipscope 9.1
file.puts format("\# %s", vhdl_comment_list[i])
file.puts format("::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 %d \"%8.8X\"\n\n", vhdl_tcl_list[i].length, vhdl_tcl_list[i].to_i(2));
end;
puts format("I-ROM TCL-loader written to \"%s\"\n",filename)
file.close
# X-ROM VHDL-ROM
filename = format("%s.xrom.vhdl.snip", PROJECT_NAME)
file = File.open(filename, "w")
file.puts format("ENTITY %s IS\n", XROM_ENTITY_NAME)
file.puts format("\tPort (\n")
file.puts format("\tclk\t\t\t: in STD_LOGIC;\n")
file.puts format("\tce\t\t\t: in STD_LOGIC;\n")
file.puts format("\taddr\t\t: in %s;\n", XROM_ADDR_TYPE)
file.puts format("\tdout\t\t: out %s\n", XROM_DATA_TYPE)
file.puts format("\t);\n")
file.puts format("END %s;\n", XROM_ENTITY_NAME)
file.puts format("\n")
file.puts format("ARCHITECTURE %s OF %s IS \n", PROJECT_NAME, XROM_ENTITY_NAME)
file.puts format("\n")
file.puts format("\ttype xmem_rom_t is array (0 to %d) of %s;\n", XROM_MAX_SIZE-1, XROM_DATA_TYPE)
file.puts format("\n")
file.puts format("\t-- Assembled from %s.%s", PROJECT_NAME, FILE_SUFFIX)
file.puts format("\tconstant xmem_rom : xmem_rom_t :=\n")
file.puts format("\t(\n");
for i in (0..XROM_MAX_SIZE-2)
file.puts format("\t\tX\"%2.2X\", -- 0x%2.2X\n", first_pass.xmem[i], i)
end;
i = XROM_MAX_SIZE-1
file.puts format("\t\tX\"%2.2X\" -- 0x%2.2X\n", first_pass.xmem[i], i)
file.puts format("\t);\n")
file.puts format("\n")
file.puts format("begin")
file.puts format("\n")
file.puts format("PROM_READ:")
file.puts format("\tprocess(clk, ce)\n")
file.puts format("\tbegin\n")
file.puts format("\t\tif rising_edge(clk) and ce = '1' then\n")
file.puts format("\t\t\tdout <= xmem_rom(to_integer(addr));\n")
file.puts format("\t\tend if;\n")
file.puts format("\tend process;\n")
file.puts format("\n")
file.puts format("end %s;\n", PROJECT_NAME)
puts format("X-ROM file written to \"%s\"\n",filename)
file.close
# X-ROM VHDL-ROM (loadable)
filename = format("%s.xrom_ld.vhdl.snip", PROJECT_NAME)
file = File.open(filename, "w")
file.puts format("\n\t-- Assembled from %s.%s", PROJECT_NAME, FILE_SUFFIX)
file.puts format("\ttype xmem_rom_t is array (0 to %d) of %s;\n", XROM_MAX_SIZE-1, XROM_DATA_TYPE)
file.puts format("\tsignal xmem_rom : xmem_rom_t :=\n")
file.puts format("\t(\n");
for i in (0..XROM_MAX_SIZE-2)
file.puts format("\t\tX\"%2.2X\", -- 0x%2.2X\n", first_pass.xmem[i], i)
end;
i = XROM_MAX_SIZE-1
file.puts format("\t\tX\"%2.2X\" -- 0x%2.2X\n", first_pass.xmem[i], i)
file.puts format("\t);\n")
puts format("X-ROM (loadable) file written to \"%s\"\n",filename)
file.close
# X-ROM TCL-Loader
filename = format("%s.xrom.tcl.snip", PROJECT_NAME)
file = File.open(filename, "w")
file.puts format("# Assembled from %s.%s", PROJECT_NAME, FILE_SUFFIX)
file.puts format("# ---------------------------------------------------------------");
file.puts format("# Shift the USER2 Instruction (b1111000011) into the Instruction Register of FPGA");
file.puts format("# User 2")
file.puts format("set result [::chipscope::csejtag_tap shift_device_ir $handle $devid $CSE_OP $CSE_ES 0 $irlength \"3C3\"]\n\n")
for i in (0..first_pass.xmem.length-1)
# Chipscope 8.1
# file.puts format("jtag_shiftdr $handle -buffer \"%s\" -endstate RTI -device $devid", vhdl_tcl_list[i].reverse);
# Chipscope 9.1
file.puts format("::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 %d \"%2.2X%2.2X\"\n", 16, i, first_pass.xmem[i]);
end;
puts format("X-ROM TCL-loader written to \"%s\"\n",filename)
file.close
end
# --------------------------------------------------------
# Output final statistics
# --------------------------------------------------------
if num_errors == 0
puts "Program uses #{first_pass.pc_max} instruction addresses"
puts "No errors found"
exit 0
else
puts "#{num_errors} errors found"
exit 1
end
-72
View File
@@ -1,72 +0,0 @@
; -------------------------------------------------
; lcd.inc.jsm
; -------------------------------------------------
; needs xio-address equates for
; reg_cg_char_addr: equ 0xXX ; RW
; reg_cg_line_addr: equ 0xXX ; RW
; reg_cg_data: equ 0xXX ; RW
; reg_cg_ctrl: equ 0xXX ; WO
; needs delay.inc.jsm
; -------------------------------------------------
cg_clr_line: push R0
mov R0, 2
xout (reg_cg_ctrl), R0
pop R0
ret
; -------------------------------------------------
cg_clr_screen: push R0
mov R0, 1
xout (reg_cg_ctrl), R0
pop R0
ret
; -------------------------------------------------
; R0 : char address
; R1 : line address
cg_set_addr: call cg_wait_rdy
xout (reg_cg_line_addr), R1
xout (reg_cg_char_addr), R0
ret
; -------------------------------------------------
; R0 : character
cg_putchar: call cg_wait_rdy
xout (reg_cg_data), R0
ret
; -------------------------------------------------
; R1 : ptr to string
cg_puts: push R0
cg_p_lp: movx R0, (R1)
inc R1
tst R0
jz ex_cgp
call cg_putchar
jmp cg_p_lp
ex_cgp: pop R0
ret
; -------------------------------------------------
; R1 : ptr to string
cg_clr_puts: call cg_clr_line
call cg_puts
ret
; -------------------------------------------------
; R1 : ptr to string
cg_puts_clr: call cg_puts
call cg_clr_line
ret
; -------------------------------------------------
cg_wait_rdy: push R0
cg_wr_lp: xin R0, (reg_hwstat)
and R0, 0x02
jz cg_wr_lp
pop R0
ret
; -------------------------------------------------
-7
View File
@@ -1,7 +0,0 @@
; JCPU On-Chip register
cpu_revision: equ 0x00 ; RO
cpu_control: equ 0x01 ; R/W
cpu_status: equ 0x02 ; RO
cpu_int_ctrl: equ 0x03 ; RW
cpu_cmem_high: equ 0x04 ; RW
cpu_stack_high: equ 0x05 ; RW
-64
View File
@@ -1,64 +0,0 @@
; -------------------------------------------------
; Delays
; -------------------------------------------------
delay1s: push R15
mov R15, 10
loop1s: call delay100ms
dec R15
jnz loop1s
pop R15
ret
delay100ms: push R15
mov R15, 10
loop100ms: call delay10ms
dec R15
jnz loop100ms
pop R15
ret
delay10ms: push R15
mov R15, 10
loop10ms: call delay1ms
dec R15
jnz loop10ms
pop R15
ret
delay1ms: push R15
mov R15, 10
loop1ms: call delay100us
dec R15
jnz loop1ms
pop R15
ret
delay100us: push R15
mov R15, 10
loop100us: call delay10us
dec R15
jnz loop100us
pop R15
ret
delay10us: push R15
mov R15, 99
loop10us: nop
nop
nop
dec R15
jnz loop10us
pop R15
ret
delay1us: push R15
mov R15, 9
loop1us: nop
nop
nop
dec R15
jnz loop1us
pop R15
ret
; -------------------------------------------------
-208
View File
@@ -1,208 +0,0 @@
; -------------------------------------------------
; lcd.inc.jsm
; -------------------------------------------------
; needs xmem-address definition for
; - lcd_port (LCD-Base)
; needs delay.inc.jsm
; -------------------------------------------------
lcd_cmd: equ 0x00
lcd_rd: equ 0x20
lcd_data: equ 0x40
lcd_enable: equ 0x80
LCD_CMD_Z1: equ 0x80
LCD_CMD_Z2: equ 0xC0
LCD_CMD_CLEAR: equ 0x01
; -------------------------------------------------
; Init LCD
; -------------------------------------------------
LCD_init: mov R2, 0x00
mov R0, 0x03
call _write_lcd
call delay10ms
mov R2, 0x00
mov R0, 0x03
call _write_lcd
call delay10ms
mov R2, 0x00
mov R0, 0x02
call _write_lcd
call delay1ms
; 1. Function set: 4-Bit mode, two display lines
mov R0, 0x28
call LCD_writecmd
; 2. Display on, no cursor
mov R0, 0x0C
call LCD_writecmd
; 3. Cursor shift during write
mov R0, 0x06
call LCD_writecmd
; 4. Display clear
mov R0, 0x01
call LCD_writecmd
ret
; -------------------------------------------------
; LCD_waitbsy
; -------------------------------------------------
LCD_waitbsy: push R0
bsy_loop: call LCD_readstat
and R0, 0x80
jz ex_bsy
call delay1us
jmp bsy_loop
ex_bsy: pop R0
ret
; -------------------------------------------------
; LCD_writecmd
; -------------------------------------------------
; R0 = cmd
LCD_writeaddr:
LCD_writecmd: push R2
mov R2, lcd_cmd
call LCD_write
pop R2
ret
; -------------------------------------------------
; LCD_putsx
; -------------------------------------------------
; R1 = address of null-terminated string in XMEM
LCD_putsx: push R0
putsx_loop: movx R0, (R1)
inc R1
tst R0
jz putsx_ex
call LCD_writechar
jmp putsx_loop
putsx_ex: pop R0
ret
; -------------------------------------------------
; LCD_putsc
; -------------------------------------------------
; R1 = address of null-terminated string in CMEM
LCD_putsc: push R0
putsc_loop: movc R0, (R1)
inc R1
tst R0
jz putsc_ex
call LCD_writechar
jmp putsc_loop
putsc_ex: pop R0
ret
; -------------------------------------------------
; LCD_writechar
; -------------------------------------------------
; R0 = char
LCD_writedata:
LCD_writechar: push R2
mov R2, lcd_data
call LCD_write
pop R2
ret
; -------------------------------------------------
; LCD_write
; -------------------------------------------------
; R0 = input
; R2 = register
LCD_write: call LCD_waitbsy
push R0
swap R0
call _write_lcd
pop R0
call _write_lcd
ret
; -------------------------------------------------
; LCD_readstat
; -------------------------------------------------
; R0 = status
LCD_readstat: push R2
mov R2, lcd_cmd
call LCD_read
pop R2
ret
; -------------------------------------------------
; LCD_read
; -------------------------------------------------
; R0 = output
; R2 = register
LCD_read: call _read_lcd
swap R0
push R0
call _read_lcd
pop R2
or R0, R2
ret
; -------------------------------------------------
; _write
; -------------------------------------------------
; R0 = input
_write_lcd: push R1
and R0, 0x0F
mov R1, R0
or R1, R2
xout (lcd_port), R1
call delay1us
mov R1, R0
or R1, R2
or R1, lcd_enable
xout (lcd_port), R1
call delay1us
mov R1, R0
or R1, R2
xout (lcd_port), R1
call delay1us
or R1, lcd_rd
xout (lcd_port), R1
pop R1
ret
; -------------------------------------------------
; _read
; -------------------------------------------------
; R0 = output
_read_lcd: push R1
mov R1, lcd_rd
or R1, R2
xout (lcd_port), R1
call delay1us
mov R1, lcd_rd
or R1, R2
or R1, lcd_enable
xout (lcd_port), R1
call delay1us
xin R0, (lcd_port)
and R0, 0x0F
mov R1, lcd_rd
or R1, R2
xout (lcd_port), R1
call delay1us
pop R1
ret
-42
View File
@@ -1,42 +0,0 @@
; -------------------------------------------------
; mul8x8.inc.jsm
; -------------------------------------------------
; -------------------------------------------------
; Parameter:
; R0 : operand 1
; R1 : operand 2
; Return:
; R0 : product low
; R1 : product high
mul8x8: push R2
push R3
push R4
mov R4, R1
mov R1, 0
mov R2, 0
mov R3, 0
loop1: cmp R4, 0x01
jeq ende1
shr R4
jnc next1
add R2, R0
addc R3, R1
next1: shl R0
rolc R1
jmp loop1
ende1: add R0, R2
addc R1, R3
pop R4
pop R3
pop R2
ret
; -------------------------------------------------
-32
View File
@@ -1,32 +0,0 @@
; -------------------------------------------------
; uart.inc.jsm
; -------------------------------------------------
; needs xmem-address definition for
; - uart_status (Status register)
; - uart_data (Data register)
; -------------------------------------------------
; sout
; -------------------------------------------------
; R0 = input
sout: push R1
sout1: xin R1, (uart_status)
and R1, 0x02
jnz sout1
xout (uart_data), R0
pop R1
ret
; -------------------------------------------------
; sin
; -------------------------------------------------
; R0 = output
sin: push R1
sin1: xin R1, (uart_status)
and R1, 0x10
jnz sin1
xin R0, (uart_data)
pop R1
ret
; -------------------------------------------------
-32
View File
@@ -1,32 +0,0 @@
; -------------------------------------------------
; utils.inc.jsm
; -------------------------------------------------
; -------------------------------------------------
; Parameter
; R0 : Bin value in lower nibble
; Return
; R0 : Hex character representing lower nibble
nibble2hex: and R0, 0x0F
cmp R0, 0x0A
jlt isNum1
add R0, 0x07
isNum1: add R0, 0x30
ret
; -------------------------------------------------
; Parameter
; R0 : Bin value
; Return
; R0 : Hex character high
; R1 : Hex character low
bin2hex: push R0
call nibble2hex
mov R1, R0
pop R0
swap R0
call nibble2hex
ret
; -------------------------------------------------
-64
View File
@@ -1,64 +0,0 @@
0 NOP
1 HALT
2 MOV|R|R
3 MOV|R|K
4 MOVX|R|Ri
5 MOVX|R|Ki
6 MOVX|Ri|R
7 MOVX|Ri|K
8 MOVX|Ki|R
9 MOVC|R|Ri
10 MOVC|R|Ki
11 MOVC|Ri|R
12 MOVC|Ri|K
13 MOVC|Ki|R
14 CMP|R|R
15 CMP|R|K
16 ADD|R|R
17 ADD|R|K
18 ADDC|R|R
19 ADDC|R|K
20 SUB|R|R
21 SUB|R|K
22 SUBC|R|R
23 SUBC|R|K
24 AND|R|R
25 AND|R|K
26 OR|R|R
27 OR|R|K
28 XOR|R|R
29 XOR|R|K
30 SHL|R
31 SHR|R
32 ROL|R
33 ROR|R
34 ROLC|R
35 RORC|R
36 XOUT|Ki|R
37 XOUT|Ri|K
38 COUT|Ki|R
39 COUT|Ri|K
40 XIN|R|Ki
41 CIN|R|Ki
42 SWAP|R
43 SETC
44 UNDEF
45 UNDEF
46 SUB|K|R
47 SUBC|K|R
48 JMP|K
49 JZ|K
50 JNZ|K
51 JC|K
52 JNC|K
53 JLT|K
54 JGT|K
55 JLE|K
56 JGE|K
57 JEQ|K
58 JNE|K
59 CALL|K
60 PUSH|R
61 POP|R
62 RET
63 RETI
-20
View File
@@ -1,20 +0,0 @@
#!/usr/bin/env ruby
st = "\033[7m"
en = "\033[m"
while TRUE
print "str> "
STDOUT.flush
str = gets
break if not str
str.chop!
print "pat> "
STDOUT.flush
re = gets
break if not re
re.chop!
str.gsub! re, "#{st}\\&#{en}"
print str, "\n"
end
print "\n"
-61
View File
@@ -1,61 +0,0 @@
# ----------------------------------------------------------------------
# Project: JCPU, a portable 8-bit RISC CPU written in VHDL
# This file: The ROM file for upload to target over JTAG
#
# Copyright (C) 2007 J. Ahrensfeld
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# For questions and ideas, please contact the author at jens@jayfield.org
#
# ---------------------------------------------------------------------
# ---------------------------------------------------------------------
# For Chipscope 9.1
# ---------------------------------------------------------------------
# Source JTAG/TCL frame work
cd $env(CHIPSCOPE)\\bin\\nt
source csejtag.tcl
namespace import ::chipscope::*
# Platform USB Cable
set PLATFORM_USB_CABLE_ARGS [list "port=USB2" "frequency=6000000"]
# frequency="24000000 | 12000000 | 6000000 | 3000000 | 1500000 | 750000"
# Create session
set handle [::chipscope::csejtag_session create 0]
# Open JTAG and lock
set open_result [::chipscope::csejtag_target open $handle $CSEJTAG_TARGET_PLATFORMUSB 0 $PLATFORM_USB_CABLE_ARGS]
set lock_result [::chipscope::csejtag_target lock $handle 1000]
set devlist [::chipscope::csejtag_tap autodetect_chain $handle $CSEJTAG_SCAN_DEFAULT]
# Get Device ID
set devtype "Virtex-4SX"
set devid 2
set irlength [::chipscope::csejtag_tap get_irlength $handle $devid]
set idcode [::chipscope::csejtag_tap get_device_idcode $handle $devid]
set CSE_OP $CSEJTAG_SHIFT_READWRITE
set CSE_ES $CSEJTAG_RUN_TEST_IDLE
# Write Program
# JASM_ROM_INSERT_HERE
::chipscope::csejtag_target unlock $handle
::chipscope::csejtag_target close $handle
::chipscope::csejtag_session destroy $handle
exit
-44
View File
@@ -1,44 +0,0 @@
#!/usr/bin/env ruby
template = <<'END'
-- (tv #1342) read output FIFO
(
cycles => 1,
cm_i => bus_read_init(addr => ADDR_KS_OFIFO_DOUT),
sep => msg(""),
cm_o => bus_no_ack,
irq => (others => '0')
),
-- (tv #1343) wait while FIFO is read
(
cycles => 2,
cm_i => bus_wait_ack,
sep => msg(""),
cm_o => bus_no_ack,
irq => (others => '0')
),
-- (tv #1343) wait for ack
(
cycles => 1,
cm_i => bus_wait_ack,
sep => msg(""),
cm_o => bus_read_ack(dat => #{exp_data}),
irq => (others => '0')
),
END
puts "KS-128 testvectors:\n"
puts "\n" * 3
0.upto(10) { |sk_no|
3.downto(0) { |sl_no|
exp_data = "slice_32(TC1_SUBKEYS(#{sk_no}), #{sl_no})"
t = template.gsub(/"/, '\\"')
puts eval("format(\"#{t}\")")
}
}
-32
View File
@@ -1,32 +0,0 @@
-------------------------------------------------------------------------
-- Project: JCPU, a portable 8-bit RISC CPU written in VHDL
-- This file: The ROM file for use in your VHDL design
--
-- Copyright (C) 2007 J. Ahrensfeld
--
-- This program is free software: you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
-- the Free Software Foundation, either version 3 of the License, or
-- (at your option) any later version.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU General Public License for more details.
--
-- You should have received a copy of the GNU General Public License
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
--
-- For questions and ideas, please contact the author at jens@jayfield.org
--
--------------------------------------------------------------------------
LIBRARY ieee;
use IEEE.STD_LOGIC_1164.ALL;
USE ieee.numeric_std.ALL;
library work;
use work.cpu_pkg.all;
-- JASM_ROM_INSERT_HERE
-151
View File
@@ -1,151 +0,0 @@
-------------------------------------------------------------------------
-- Project: JCPU, a portable 8-bit RISC CPU written in VHDL
-- This file: loadable ROM
--
-- Copyright (C) 2007 J. Ahrensfeld
--
-- This program is free software: you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
-- the Free Software Foundation, either version 3 of the License, or
-- (at your option) any later version.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU General Public License for more details.
--
-- You should have received a copy of the GNU General Public License
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
--
-- For questions and ideas, please contact the author at jens@jayfield.org
--
--------------------------------------------------------------------------
LIBRARY ieee;
use IEEE.STD_LOGIC_1164.ALL;
USE ieee.numeric_std.ALL;
library UNISIM;
use UNISIM.VComponents.all;
library work;
use work.cpu_pkg.all;
ENTITY xrom IS
Port (
clk : in STD_LOGIC;
ce : in STD_LOGIC;
addr : in dmem_addr_t;
dout : out dmem_data_t
);
END xrom;
ARCHITECTURE loadable OF xrom IS
-- JASM_ROM_INSERT_HERE
signal jtag_ld_clk : STD_LOGIC;
signal jtag_ld_we : STD_LOGIC;
signal jtag_ld_addr : dmem_addr_t;
signal jtag_ld_dout : dmem_data_t;
signal jtag_ld_din : dmem_data_t;
signal bs_rst, bs_sel, bs_shift, bs_tdi, bs_tdo : std_logic;
signal bs_capture, bs_clk0, bs_clk1, bs_update0, bs_update1 : std_logic;
signal user_regi, user_rego : unsigned (15 downto 0);
constant id : unsigned (15 downto 0) := X"BEEF";
begin
--------------------------------------------------------------------------
-- Virtex-4: JTAG Loader
--------------------------------------------------------------------------
i00_BUFG : BUFG
port map
(
O => bs_clk1,
I => bs_clk0
);
i01_BUFG : BUFG
port map
(
O => bs_update1,
I => bs_update0
);
BSCAN_VIRTEX4_inst2 : BSCAN_VIRTEX4
generic map
(
JTAG_CHAIN => 2 -- Value to set BSCAN site of device. Possible values: (1,2,3 or 4)
)
port map
(
CAPTURE => bs_capture, -- CAPTURE output from TAP controller
DRCK => bs_clk0, -- Data register output for USER functions
RESET => bs_rst, -- Reset output from TAP controller
SEL => bs_sel, -- USER active output
SHIFT => bs_shift, -- SHIFT output from TAP controller
TDI => bs_tdi, -- TDI output from TAP controller
UPDATE => bs_update0, -- UPDATE output from TAP controller
TDO => bs_tdo -- Data input for USER function
);
jtag_ld_addr <= user_regi(user_regi'left downto user_regi'left-dmem_data_t'length+1);
jtag_ld_din <= user_regi(dmem_data_t'left downto 0);
jtag_ld_clk <= bs_update1;
jtag_ld_we <= bs_sel;
sipo:
process (bs_rst, bs_clk1, bs_tdi, bs_shift)
begin
if bs_rst = '1' then
user_regi <= (others => '0');
elsif rising_edge(bs_clk1) then
if bs_shift = '1' then
user_regi <= bs_tdi & user_regi(user_regi'left downto 1);
end if;
end if;
end process;
piso:
process (bs_rst, bs_clk1, bs_shift, user_rego)
begin
bs_tdo <= user_rego(0);
if bs_rst = '1' then
user_rego <= (others => '0');
elsif rising_edge(bs_clk1) then
if bs_shift = '1' then
user_rego <= user_rego(0) & user_rego(user_rego'left downto 1);
else
user_rego <= (user_rego'left downto dmem_data_t'length => '0') & jtag_ld_dout;
-- user_rego <= id;
end if;
end if;
end process;
--------------------------------------------------------------------------
-- ROM Read/Write
--------------------------------------------------------------------------
PROM_READ:
process(clk, ce)
begin
if rising_edge(clk) and ce = '1' then
dout <= xmem_rom(to_integer(addr));
end if;
end process;
PROM_WRITE:
process(jtag_ld_clk, jtag_ld_we)
begin
if rising_edge(jtag_ld_clk) then
if jtag_ld_we = '1' then
xmem_rom(to_integer(jtag_ld_addr)) <= jtag_ld_din;
else
jtag_ld_dout <= xmem_rom(to_integer(jtag_ld_addr));
end if;
end if;
end process;
--------------------------------------------------------------------------
end loadable;
@@ -0,0 +1,34 @@
VHDL/lib/CPUs/MIPS/bsp/examples/dbg.c
VHDL/lib/CPUs/MIPS/bsp/examples/irq.c
VHDL/lib/CPUs/MIPS/bsp/examples/irq.h
VHDL/lib/CPUs/MIPS/bsp/examples/kernel.S
VHDL/lib/CPUs/MIPS/bsp/examples/libsys.c
VHDL/lib/CPUs/MIPS/bsp/examples/libsys.h
VHDL/lib/CPUs/MIPS/bsp/examples/mips_gfx.c
VHDL/lib/CPUs/MIPS/bsp/examples/mips_gfx.h
VHDL/lib/CPUs/MIPS/bsp/examples/mips_ps2.c
VHDL/lib/CPUs/MIPS/bsp/examples/mips_ps2.h
VHDL/lib/CPUs/MIPS/bsp/examples/mipsdis.c
VHDL/lib/CPUs/MIPS/bsp/examples/mipsdis.h
VHDL/lib/CPUs/MIPS/bsp/examples/regdef.h
VHDL/lib/CPUs/MIPS/bsp/examples/startup.S
VHDL/lib/CPUs/MIPS/bsp/examples/xcpt.c
VHDL/lib/CPUs/MIPS/bsp/examples/xcpt.h
VHDL/lib/CPUs/MIPS/bsp/examples/xcpt_asm.h
+87
View File
@@ -0,0 +1,87 @@
/************************************************************************/
/* Ein Programm zur Berechnung der Bessel-Koeffizienten Jn
/* Dateiname : Bessel.cpp
/* Autoren : T. Burr, J. Ahrensfeld
/* Datum : 28.10.1999
/* letzte Änderung : 28.01.2000
/* Version : 1.0
/************************************************************************/
#include "stdio.h"
#include "math.h"
#include "stdlib.h"
#define MAX_SUM 25
#define VERSION "1.0"
/************************************************************************/
/* Funktionsdeklarationen */
/************************************************************************/
// Fakultätsberechnung
double fak (int N)
{
int index;
double erg=1;
for (index = 1; index <= N; index++)
erg = erg * index;
return erg;
}
// Bessel()
// Berechnung von Jn von mfm
double bessel(int n, double mfm)
{
int m;
double Jn=0;
for (m=0; m < MAX_SUM; m++)
{
Jn = Jn + (pow(-1.0,m)/(fak(m)*fak(m+n))*pow(mfm/2.0,(2*m+n)));
}
return Jn;
}
/************************************************************************/
/* Das Hauptprogramm
/************************************************************************/
void main()
{
int N, Nmax;
double erg;
float mfm;
printf("\n\t Besselfunktion Version %s",VERSION);
printf("\n\t ~~~~~~~~~~~~~~~~~~~~~~~~~~\n");
printf("\n\tCopyright by J. Ahrensfeld & T. Burr\n\n");
// ---------------------------------------------------------------------------------
// Benutzereingaben
printf("\nBerechnungen fuer J = 0...");
if(scanf("%d",&Nmax)==0)
exit (-1);
printf("Bitte Modulationsindex eingeben : ");
if(scanf("%f",&mfm)==0)
exit(-1);
printf("\n");
// ---------------------------------------------------------------------------------
// Berechnung
for (N=0; N <= Nmax; N++)
{
erg = bessel(N,(double)mfm);
printf("J(%d) = %10.8f\n",N,erg);
}
printf("FERTIG.\n");
}
/************************************************************************/
+333
View File
@@ -0,0 +1,333 @@
ENDIAN='big'
ifeq ($(ENDIAN), 'big')
ENDIAN_FLAGS=-EB
CFLAGS=$(ENDIAN_FLAGS) -specs=specs/eb/specs -msoft-float -O2 -march=r3000 -I. -Ilibsys -Wl,-M
else
ENDIAN_FLAGS=-EL
CFLAGS=$(ENDIAN_FLAGS) -specs=specs/specs -msoft-float -O2 -march=r3000 -I. -Ilibsys -Wl,-M
endif
LIBS=-lm -lsys
AS=mipsel-elf-as
AR=mipsel-elf-ar
CC=mipsel-elf-gcc
LD=mipsel-elf-ld
OBJDUMP=mipsel-elf-objdump
OBJCOPY=mipsel-elf-objcopy
FLASHGEN=flashgen
PROG = hello.elf testbench.elf test_irq.elf dhry.elf queens.elf stanford.elf paranoia.elf rmd160_test.elf Bessel.elf whet.elf phrasen.elf dttl.elf richards_benchmark.elf test_exception.elf life.elf r3.elf gunzip.elf basic_math.elf jman_patches.elf jman_patchmeshes.elf jman_polys.elf test_hpi.elf test_vga.elf
all: $(PROG)
libsys.a:
$(MAKE) -C libsys
hello.elf: hello.c libsys.a
$(CC) $(CFLAGS) -o $@ -Os hello.c $(LIBS) >$@.map
$(OBJDUMP) -d $@ > $@.dis
$(OBJCOPY) $@ -O binary $@.bin
$(OBJCOPY) -O srec $@ $@.srec
$(FLASHGEN) $@.bin $(ENDIAN_FLAGS)
cat $@.srec | packhex > $@.pack
testbench.elf: testbench.c libsys.a
$(CC) $(CFLAGS) -O3 -o $@ -DHZ=1000 -DNOSIGNAL -DBATCHMODE -DNOMAIN -Os -g testbench.c paranoia.c delay_mips.c bogomips.c $(LIBS) >$@.map
$(OBJDUMP) -d $@ > $@.dis
$(OBJCOPY) $@ -O binary $@.bin
$(OBJCOPY) -O srec $@ $@.srec
$(FLASHGEN) $@.bin $(ENDIAN_FLAGS)
cat $@.srec | packhex > $@.pack
test_irq.elf: test_irq.c libsys.a
$(CC) $(CFLAGS) -o $@ test_irq.c $(LIBS) >$@.map
$(OBJDUMP) -d $@ > $@.dis
$(OBJCOPY) $@ -O binary $@.bin
$(OBJCOPY) -O srec $@ $@.srec
$(FLASHGEN) $@.bin $(ENDIAN_FLAGS)
cat $@.srec | packhex > $@.pack
dhry.elf: dhry_1.c dhry_2.c dhry.h libsys.a
$(CC) $(CFLAGS) -o $@ -DHZ=1000 dhry_1.c dhry_2.c $(LIBS) >$@.map
$(OBJDUMP) -d $@ > $@.dis
$(OBJCOPY) $@ -O binary $@.bin
$(OBJCOPY) -O srec $@ $@.srec
$(FLASHGEN) $@.bin $(ENDIAN_FLAGS)
cat $@.srec | packhex > $@.pack
queens.elf: queens.c libsys.a
$(CC) $(CFLAGS) -o $@ -DUNIX_Old -DHZ=1000 queens.c $(LIBS) >$@.map
$(OBJDUMP) -d $@ > $@.dis
$(OBJCOPY) $@ -O binary $@.bin
$(OBJCOPY) -O srec $@ $@.srec
$(FLASHGEN) $@.bin $(ENDIAN_FLAGS)
cat $@.srec | packhex > $@.pack
stanford.elf: stanford.c libsys.a
$(CC) $(CFLAGS) -O3 -o $@ -DHZ=1000 stanford.c $(LIBS) >$@.map
$(OBJDUMP) -d $@ > $@.dis
$(OBJCOPY) $@ -O binary $@.bin
$(OBJCOPY) -O srec $@ $@.srec
$(FLASHGEN) $@.bin $(ENDIAN_FLAGS)
cat $@.srec | packhex > $@.pack
paranoia.elf: paranoia.c libsys.a
$(CC) $(CFLAGS) -O3 -o $@ -DNOSIGNAL -DBATCHMODE paranoia.c $(LIBS) >$@.map
$(OBJDUMP) -d $@ > $@.dis
$(OBJCOPY) $@ -O binary $@.bin
$(OBJCOPY) -O srec $@ $@.srec
$(FLASHGEN) $@.bin $(ENDIAN_FLAGS)
cat $@.srec | packhex > $@.pack
rmd160_test.elf: rmd160_test.c rmd160.c rmd160.h libsys.a
$(CC) $(CFLAGS) -O3 -o $@ rmd160_test.c rmd160.c $(LIBS) >$@.map
$(OBJDUMP) -d $@ > $@.dis
$(OBJCOPY) $@ -O binary $@.bin
$(OBJCOPY) -O srec $@ $@.srec
$(FLASHGEN) $@.bin $(ENDIAN_FLAGS)
cat $@.srec | packhex > $@.pack
hashtest.elf: hashtest.c rmd160.c rmd160.h libsys.a
$(CC) $(CFLAGS) -O3 -o $@ hashtest.c rmd160.c $(LIBS) >$@.map
$(OBJDUMP) -d $@ > $@.dis
$(OBJCOPY) $@ -O binary $@.bin
$(OBJCOPY) -O srec $@ $@.srec
$(FLASHGEN) $@.bin $(ENDIAN_FLAGS)
cat $@.srec | packhex > $@.pack
Bessel.elf: Bessel.c libsys.a
$(CC) $(CFLAGS) -o $@ Bessel.c $(LIBS) >$@.map
$(OBJDUMP) -d $@ > $@.dis
$(OBJCOPY) $@ -O binary $@.bin
$(OBJCOPY) -O srec $@ $@.srec
$(FLASHGEN) $@.bin $(ENDIAN_FLAGS)
cat $@.srec | packhex > $@.pack
whet.elf: whet.c libsys.a
$(CC) $(CFLAGS) -o $@ whet.c $(LIBS) >$@.map
$(OBJDUMP) -d $@ > $@.dis
$(OBJCOPY) $@ -O binary $@.bin
$(OBJCOPY) -O srec $@ $@.srec
$(FLASHGEN) $@.bin $(ENDIAN_FLAGS)
cat $@.srec | packhex > $@.pack
phrasen.elf: phrasen.c libsys.a
$(CC) $(CFLAGS) -o $@ phrasen.c $(LIBS) >$@.map
$(OBJDUMP) -d $@ > $@.dis
$(OBJCOPY) $@ -O binary $@.bin
$(OBJCOPY) -O srec $@ $@.srec
$(FLASHGEN) $@.bin $(ENDIAN_FLAGS)
cat $@.srec | packhex > $@.pack
dttl.elf: dttl.c random.c libsys.a
$(CC) $(CFLAGS) -o $@ dttl.c random.c $(LIBS) >$@.map
$(OBJDUMP) -d $@ > $@.dis
$(OBJCOPY) $@ -O binary $@.bin
$(OBJCOPY) -O srec $@ $@.srec
$(FLASHGEN) $@.bin $(ENDIAN_FLAGS)
cat $@.srec | packhex > $@.pack
richards_benchmark.elf: richards_benchmark.c libsys.a
$(CC) $(CFLAGS) -o $@ richards_benchmark.c $(LIBS) >$@.map
$(OBJDUMP) -d $@ > $@.dis
$(OBJCOPY) $@ -O binary $@.bin
$(OBJCOPY) -O srec $@ $@.srec
$(FLASHGEN) $@.bin $(ENDIAN_FLAGS)
cat $@.srec | packhex > $@.pack
test_exception.elf: test_exception.c libsys.a
$(CC) $(CFLAGS) -o $@ -O1 test_exception.c $(LIBS) >$@.map
$(OBJDUMP) -d $@ > $@.dis
$(OBJCOPY) $@ -O binary $@.bin
$(OBJCOPY) -O srec $@ $@.srec
$(FLASHGEN) $@.bin $(ENDIAN_FLAGS)
cat $@.srec | packhex > $@.pack
life.elf: life.c libsys.a
$(CC) $(CFLAGS) -o $@ -g life.c $(LIBS) >$@.map
$(OBJDUMP) -d $@ > $@.dis
$(OBJCOPY) $@ -O binary $@.bin
$(OBJCOPY) -O srec $@ $@.srec
$(FLASHGEN) $@.bin $(ENDIAN_FLAGS)
cat $@.srec | packhex > $@.pack
r3.elf: r3.c libsys.a
$(CC) $(CFLAGS) -O3 -o $@ -DJMIPS_VGA -O2 r3.c $(LIBS) >$@.map
$(OBJDUMP) -d $@ > $@.dis
$(OBJCOPY) $@ -O binary $@.bin
$(OBJCOPY) -O srec $@ $@.srec
$(FLASHGEN) $@.bin $(ENDIAN_FLAGS)
cat $@.srec | packhex > $@.pack
gunzip.elf: gunzip.c inflate.c crc32.c libsys.a
$(CC) $(CFLAGS) -o $@ -o $@ gunzip.c inflate.c crc32.c $(LIBS) >$@.map
$(OBJDUMP) -d $@ > $@.dis
$(OBJCOPY) $@ -O binary $@.bin
$(OBJCOPY) -O srec $@ $@.srec
$(FLASHGEN) $@.bin $(ENDIAN_FLAGS)
cat $@.srec | packhex > $@.pack
basic_math.elf: basicmath_small.c rad2deg.c cubic.c isqrt.c libsys.a
$(CC) $(CFLAGS) -o $@ -o $@ basicmath_small.c rad2deg.c cubic.c isqrt.c $(LIBS) >$@.map
$(OBJDUMP) -d $@ > $@.dis
$(OBJCOPY) $@ -O binary $@.bin
$(OBJCOPY) -O srec $@ $@.srec
$(FLASHGEN) $@.bin $(ENDIAN_FLAGS)
cat $@.srec | packhex > $@.pack
JMAN_SRC= \
jman/bintree.c \
jman/camset.c \
jman/engine.c \
jman/graph_state.c \
jman/grid.c \
jman/imageio.c \
jman/linklist.c \
jman/matrix.c \
jman/object.c \
jman/render.c \
jman/ri.c \
jman/ribgen.c \
jman/stack.c \
jman/vars.c
jman_patches.elf: $(JMAN_SRC) jman/main_patches.c libsys.a
$(CC) $(CFLAGS) -I../ -o $@ -o $@ jman/main_patches.c $(JMAN_SRC) $(LIBS) >$@.map
$(OBJDUMP) -d $@ > $@.dis
$(OBJCOPY) $@ -O binary $@.bin
$(OBJCOPY) -O srec $@ $@.srec
$(FLASHGEN) $@.bin $(ENDIAN_FLAGS)
cat $@.srec | packhex > $@.pack
jman_patchmeshes.elf: $(JMAN_SRC) jman/main_patchmeshes.c jman/patches2.c libsys.a
$(CC) $(CFLAGS) -I../ -o $@ -o $@ jman/main_patchmeshes.c jman/patches2.c $(JMAN_SRC) $(LIBS) >$@.map
$(OBJDUMP) -d $@ > $@.dis
$(OBJCOPY) $@ -O binary $@.bin
$(OBJCOPY) -O srec $@ $@.srec
$(FLASHGEN) $@.bin $(ENDIAN_FLAGS)
cat $@.srec | packhex > $@.pack
jman_polys.elf: $(JMAN_SRC) jman/main_polypin.c jman/polys.c libsys.a
$(CC) $(CFLAGS) -I../ -o $@ -o $@ jman/main_polypin.c jman/polys.c $(JMAN_SRC) $(LIBS) >$@.map
$(OBJDUMP) -d $@ > $@.dis
$(OBJCOPY) $@ -O binary $@.bin
$(OBJCOPY) -O srec $@ $@.srec
$(FLASHGEN) $@.bin $(ENDIAN_FLAGS)
cat $@.srec | packhex > $@.pack
serdump.elf: serdump.c libsys.a
$(CC) $(CFLAGS) -O3 -o $@ -O2 serdump.c $(LIBS) >$@.map
$(OBJDUMP) -d $@ > $@.dis
$(OBJCOPY) $@ -O binary $@.bin
$(OBJCOPY) -O srec $@ $@.srec
$(FLASHGEN) $@.bin $(ENDIAN_FLAGS)
cat $@.srec | packhex > $@.pack
pppi.elf: pppissue/test1.c pppissue/utils.c pppissue/pppd.h libsys.a
$(CC) $(CFLAGS) -O2 -o $@ -O2 pppissue/test1.c pppissue/utils.c $(LIBS) >$@.map
$(OBJDUMP) -d $@ > $@.dis
$(OBJCOPY) $@ -O binary $@.bin
$(OBJCOPY) -O srec $@ $@.srec
$(FLASHGEN) $@.bin $(ENDIAN_FLAGS)
cat $@.srec | packhex > $@.pack
lwl.elf: lwl.c libsys.a
$(CC) $(CFLAGS) -O2 -o $@ lwl.c $(LIBS) >$@.map
$(OBJDUMP) -d $@ > $@.dis
$(OBJCOPY) $@ -O binary $@.bin
$(OBJCOPY) -O srec $@ $@.srec
$(FLASHGEN) $@.bin $(ENDIAN_FLAGS)
cat $@.srec | packhex > $@.pack
ucb.elf: ucb.c libsys.a
$(CC) $(CFLAGS) -O2 -o $@ ucb.c $(LIBS) >$@.map
$(OBJDUMP) -d $@ > $@.dis
$(OBJCOPY) $@ -O binary $@.bin
$(OBJCOPY) -O srec $@ $@.srec
$(FLASHGEN) $@.bin $(ENDIAN_FLAGS)
cat $@.srec | packhex > $@.pack
test_hpi.elf: hpi.c test_hpi.c cfiflash.c libsys.a
$(CC) $(CFLAGS) -o $@ -g hpi.c test_hpi.c cfiflash.c $(LIBS) >$@.map
$(OBJDUMP) -d $@ > $@.dis
$(OBJCOPY) $@ -O binary $@.bin
$(OBJCOPY) -O srec $@ $@.srec
$(FLASHGEN) $@.bin
cat $@.srec | packhex > $@.pack
test_vga.elf: test_vga.c libsys.a
$(CC) $(CFLAGS) -o $@ test_vga.c $(LIBS) >$@.map
$(OBJDUMP) -d $@ > $@.dis
$(OBJCOPY) $@ -O binary $@.bin
$(OBJCOPY) -O srec $@ $@.srec
$(FLASHGEN) $@.bin $(ENDIAN_FLAGS)
cat $@.srec | packhex > $@.pack
barcode.elf: barcode.c libsys.a
$(CC) $(CFLAGS) -o $@ barcode.c $(LIBS) >$@.map
$(OBJDUMP) -d $@ > $@.dis
$(OBJCOPY) $@ -O binary $@.bin
$(OBJCOPY) -O srec $@ $@.srec
$(FLASHGEN) $@.bin $(ENDIAN_FLAGS)
cat $@.srec | packhex > $@.pack
lua.elf: lua_init.c libsys.a
$(CC) $(CFLAGS) -I./lua-5.1.4/etc -I./lua-5.1.4/src -o $@ lua_init.c $(LIBS) >$@.map
$(OBJDUMP) -d $@ > $@.dis
$(OBJCOPY) $@ -O binary $@.bin
$(OBJCOPY) -O srec $@ $@.srec
$(FLASHGEN) $@.bin $(ENDIAN_FLAGS)
cat $@.srec | packhex > $@.pack
mandelbrot.elf: mandelbrot.c libsys.a
$(CC) $(CFLAGS) -o $@ mandelbrot.c $(LIBS) >$@.map
$(OBJDUMP) -d $@ > $@.dis
$(OBJCOPY) $@ -O binary $@.bin
$(OBJCOPY) -O srec $@ $@.srec
$(FLASHGEN) $@.bin $(ENDIAN_FLAGS)
cat $@.srec | packhex > $@.pack
bogomips.elf: bogomips.c delay_mips.c libsys.a
$(CC) $(CFLAGS) -DHZ=1000 -o $@ bogomips.c delay_mips.c $(LIBS) >$@.map
$(OBJDUMP) -d $@ > $@.dis
$(OBJCOPY) $@ -O binary $@.bin
$(OBJCOPY) -O srec $@ $@.srec
$(FLASHGEN) $@.bin $(ENDIAN_FLAGS)
cat $@.srec | packhex > $@.pack
test_asm.elf: test_asm.S libsys.a
$(CC) $(CFLAGS) -DHZ=1000 -o $@ test_asm.S $(LIBS) >$@.map
$(OBJDUMP) -d $@ > $@.dis
$(OBJCOPY) $@ -O binary $@.bin
$(OBJCOPY) -O srec $@ $@.srec
$(FLASHGEN) $@.bin $(ENDIAN_FLAGS)
cat $@.srec | packhex > $@.pack
test_ac97.elf: test_ac97.c libsys.a
$(CC) $(CFLAGS) -o $@ test_ac97.c $(LIBS) >$@.map
$(OBJDUMP) -d $@ > $@.dis
$(OBJCOPY) $@ -O binary $@.bin
$(OBJCOPY) -O srec $@ $@.srec
$(FLASHGEN) $@.bin $(ENDIAN_FLAGS)
cat $@.srec | packhex > $@.pack
test_dcache.elf: test_dcache.c libsys.a
$(CC) $(CFLAGS) -O0 -o $@ test_dcache.c $(LIBS) >$@.map
$(OBJDUMP) -d $@ > $@.dis
$(OBJCOPY) $@ -O binary $@.bin
$(OBJCOPY) -O srec $@ $@.srec
$(FLASHGEN) $@.bin $(ENDIAN_FLAGS)
cat $@.srec | packhex > $@.pack
aes256_1.elf: aes256_1.c aes256.c aes256.h libsys.a
$(CC) $(CFLAGS) -O3 -o $@ aes256_1.c aes256.c $(LIBS) >$@.map
$(OBJDUMP) -d $@ > $@.dis
$(OBJCOPY) $@ -O binary $@.bin
$(OBJCOPY) -O srec $@ $@.srec
$(FLASHGEN) $@.bin $(ENDIAN_FLAGS)
cat $@.srec | packhex > $@.pack
clean:
rm -rf *.a *.o *.bin *.map *.dis *.srec *.pack *.elf $(PROG) > /dev/null
+359
View File
@@ -0,0 +1,359 @@
/*
* Byte-oriented AES-256 implementation.
* All lookup tables replaced with 'on the fly' calculations.
*
* Copyright (c) 2007-2009 Ilya O. Levin, http://www.literatecode.com
* Other contributors: Hal Finney
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
#include "aes256.h"
#define F(x) (((x)<<1) ^ ((((x)>>7) & 1) * 0x1b))
#define FD(x) (((x) >> 1) ^ (((x) & 1) ? 0x8d : 0))
#define BACK_TO_TABLES
#ifdef BACK_TO_TABLES
const uint8_t sbox[256] = {
0x63, 0x7c, 0x77, 0x7b, 0xf2, 0x6b, 0x6f, 0xc5,
0x30, 0x01, 0x67, 0x2b, 0xfe, 0xd7, 0xab, 0x76,
0xca, 0x82, 0xc9, 0x7d, 0xfa, 0x59, 0x47, 0xf0,
0xad, 0xd4, 0xa2, 0xaf, 0x9c, 0xa4, 0x72, 0xc0,
0xb7, 0xfd, 0x93, 0x26, 0x36, 0x3f, 0xf7, 0xcc,
0x34, 0xa5, 0xe5, 0xf1, 0x71, 0xd8, 0x31, 0x15,
0x04, 0xc7, 0x23, 0xc3, 0x18, 0x96, 0x05, 0x9a,
0x07, 0x12, 0x80, 0xe2, 0xeb, 0x27, 0xb2, 0x75,
0x09, 0x83, 0x2c, 0x1a, 0x1b, 0x6e, 0x5a, 0xa0,
0x52, 0x3b, 0xd6, 0xb3, 0x29, 0xe3, 0x2f, 0x84,
0x53, 0xd1, 0x00, 0xed, 0x20, 0xfc, 0xb1, 0x5b,
0x6a, 0xcb, 0xbe, 0x39, 0x4a, 0x4c, 0x58, 0xcf,
0xd0, 0xef, 0xaa, 0xfb, 0x43, 0x4d, 0x33, 0x85,
0x45, 0xf9, 0x02, 0x7f, 0x50, 0x3c, 0x9f, 0xa8,
0x51, 0xa3, 0x40, 0x8f, 0x92, 0x9d, 0x38, 0xf5,
0xbc, 0xb6, 0xda, 0x21, 0x10, 0xff, 0xf3, 0xd2,
0xcd, 0x0c, 0x13, 0xec, 0x5f, 0x97, 0x44, 0x17,
0xc4, 0xa7, 0x7e, 0x3d, 0x64, 0x5d, 0x19, 0x73,
0x60, 0x81, 0x4f, 0xdc, 0x22, 0x2a, 0x90, 0x88,
0x46, 0xee, 0xb8, 0x14, 0xde, 0x5e, 0x0b, 0xdb,
0xe0, 0x32, 0x3a, 0x0a, 0x49, 0x06, 0x24, 0x5c,
0xc2, 0xd3, 0xac, 0x62, 0x91, 0x95, 0xe4, 0x79,
0xe7, 0xc8, 0x37, 0x6d, 0x8d, 0xd5, 0x4e, 0xa9,
0x6c, 0x56, 0xf4, 0xea, 0x65, 0x7a, 0xae, 0x08,
0xba, 0x78, 0x25, 0x2e, 0x1c, 0xa6, 0xb4, 0xc6,
0xe8, 0xdd, 0x74, 0x1f, 0x4b, 0xbd, 0x8b, 0x8a,
0x70, 0x3e, 0xb5, 0x66, 0x48, 0x03, 0xf6, 0x0e,
0x61, 0x35, 0x57, 0xb9, 0x86, 0xc1, 0x1d, 0x9e,
0xe1, 0xf8, 0x98, 0x11, 0x69, 0xd9, 0x8e, 0x94,
0x9b, 0x1e, 0x87, 0xe9, 0xce, 0x55, 0x28, 0xdf,
0x8c, 0xa1, 0x89, 0x0d, 0xbf, 0xe6, 0x42, 0x68,
0x41, 0x99, 0x2d, 0x0f, 0xb0, 0x54, 0xbb, 0x16
};
const uint8_t sboxinv[256] = {
0x52, 0x09, 0x6a, 0xd5, 0x30, 0x36, 0xa5, 0x38,
0xbf, 0x40, 0xa3, 0x9e, 0x81, 0xf3, 0xd7, 0xfb,
0x7c, 0xe3, 0x39, 0x82, 0x9b, 0x2f, 0xff, 0x87,
0x34, 0x8e, 0x43, 0x44, 0xc4, 0xde, 0xe9, 0xcb,
0x54, 0x7b, 0x94, 0x32, 0xa6, 0xc2, 0x23, 0x3d,
0xee, 0x4c, 0x95, 0x0b, 0x42, 0xfa, 0xc3, 0x4e,
0x08, 0x2e, 0xa1, 0x66, 0x28, 0xd9, 0x24, 0xb2,
0x76, 0x5b, 0xa2, 0x49, 0x6d, 0x8b, 0xd1, 0x25,
0x72, 0xf8, 0xf6, 0x64, 0x86, 0x68, 0x98, 0x16,
0xd4, 0xa4, 0x5c, 0xcc, 0x5d, 0x65, 0xb6, 0x92,
0x6c, 0x70, 0x48, 0x50, 0xfd, 0xed, 0xb9, 0xda,
0x5e, 0x15, 0x46, 0x57, 0xa7, 0x8d, 0x9d, 0x84,
0x90, 0xd8, 0xab, 0x00, 0x8c, 0xbc, 0xd3, 0x0a,
0xf7, 0xe4, 0x58, 0x05, 0xb8, 0xb3, 0x45, 0x06,
0xd0, 0x2c, 0x1e, 0x8f, 0xca, 0x3f, 0x0f, 0x02,
0xc1, 0xaf, 0xbd, 0x03, 0x01, 0x13, 0x8a, 0x6b,
0x3a, 0x91, 0x11, 0x41, 0x4f, 0x67, 0xdc, 0xea,
0x97, 0xf2, 0xcf, 0xce, 0xf0, 0xb4, 0xe6, 0x73,
0x96, 0xac, 0x74, 0x22, 0xe7, 0xad, 0x35, 0x85,
0xe2, 0xf9, 0x37, 0xe8, 0x1c, 0x75, 0xdf, 0x6e,
0x47, 0xf1, 0x1a, 0x71, 0x1d, 0x29, 0xc5, 0x89,
0x6f, 0xb7, 0x62, 0x0e, 0xaa, 0x18, 0xbe, 0x1b,
0xfc, 0x56, 0x3e, 0x4b, 0xc6, 0xd2, 0x79, 0x20,
0x9a, 0xdb, 0xc0, 0xfe, 0x78, 0xcd, 0x5a, 0xf4,
0x1f, 0xdd, 0xa8, 0x33, 0x88, 0x07, 0xc7, 0x31,
0xb1, 0x12, 0x10, 0x59, 0x27, 0x80, 0xec, 0x5f,
0x60, 0x51, 0x7f, 0xa9, 0x19, 0xb5, 0x4a, 0x0d,
0x2d, 0xe5, 0x7a, 0x9f, 0x93, 0xc9, 0x9c, 0xef,
0xa0, 0xe0, 0x3b, 0x4d, 0xae, 0x2a, 0xf5, 0xb0,
0xc8, 0xeb, 0xbb, 0x3c, 0x83, 0x53, 0x99, 0x61,
0x17, 0x2b, 0x04, 0x7e, 0xba, 0x77, 0xd6, 0x26,
0xe1, 0x69, 0x14, 0x63, 0x55, 0x21, 0x0c, 0x7d
};
#define rj_sbox(x) sbox[(x)]
#define rj_sbox_inv(x) sboxinv[(x)]
#else /* tableless subroutines */
/* -------------------------------------------------------------------------- */
uint8_t gf_alog(uint8_t x) // calculate anti-logarithm gen 3
{
uint8_t atb = 1, z;
while (x--) {z = atb; atb <<= 1; if (z & 0x80) atb^= 0x1b; atb ^= z;}
return atb;
} /* gf_alog */
/* -------------------------------------------------------------------------- */
uint8_t gf_log(uint8_t x) // calculate logarithm gen 3
{
uint8_t atb = 1, i = 0, z;
do {
if (atb == x) break;
z = atb; atb <<= 1; if (z & 0x80) atb^= 0x1b; atb ^= z;
} while (++i > 0);
return i;
} /* gf_log */
/* -------------------------------------------------------------------------- */
uint8_t gf_mulinv(uint8_t x) // calculate multiplicative inverse
{
return (x) ? gf_alog(255 - gf_log(x)) : 0;
} /* gf_mulinv */
/* -------------------------------------------------------------------------- */
uint8_t rj_sbox(uint8_t x)
{
uint8_t y, sb;
sb = y = gf_mulinv(x);
y = (y<<1)|(y>>7); sb ^= y; y = (y<<1)|(y>>7); sb ^= y;
y = (y<<1)|(y>>7); sb ^= y; y = (y<<1)|(y>>7); sb ^= y;
return (sb ^ 0x63);
} /* rj_sbox */
/* -------------------------------------------------------------------------- */
uint8_t rj_sbox_inv(uint8_t x)
{
uint8_t y, sb;
y = x ^ 0x63;
sb = y = (y<<1)|(y>>7);
y = (y<<2)|(y>>6); sb ^= y; y = (y<<3)|(y>>5); sb ^= y;
return gf_mulinv(sb);
} /* rj_sbox_inv */
#endif
/* -------------------------------------------------------------------------- */
uint8_t rj_xtime(uint8_t x)
{
return (x & 0x80) ? ((x << 1) ^ 0x1b) : (x << 1);
} /* rj_xtime */
/* -------------------------------------------------------------------------- */
void aes_subBytes(uint8_t *buf)
{
register uint8_t i = 16;
while (i--) buf[i] = rj_sbox(buf[i]);
} /* aes_subBytes */
/* -------------------------------------------------------------------------- */
void aes_subBytes_inv(uint8_t *buf)
{
register uint8_t i = 16;
while (i--) buf[i] = rj_sbox_inv(buf[i]);
} /* aes_subBytes_inv */
/* -------------------------------------------------------------------------- */
void aes_addRoundKey(uint8_t *buf, uint8_t *key)
{
register uint8_t i = 16;
while (i--) buf[i] ^= key[i];
} /* aes_addRoundKey */
/* -------------------------------------------------------------------------- */
void aes_addRoundKey_cpy(uint8_t *buf, uint8_t *key, uint8_t *cpk)
{
register uint8_t i = 16;
while (i--) buf[i] ^= (cpk[i] = key[i]), cpk[16+i] = key[16 + i];
} /* aes_addRoundKey_cpy */
/* -------------------------------------------------------------------------- */
void aes_shiftRows(uint8_t *buf)
{
register uint8_t i, j; /* to make it potentially parallelable :) */
i = buf[1]; buf[1] = buf[5]; buf[5] = buf[9]; buf[9] = buf[13]; buf[13] = i;
i = buf[10]; buf[10] = buf[2]; buf[2] = i;
j = buf[3]; buf[3] = buf[15]; buf[15] = buf[11]; buf[11] = buf[7]; buf[7] = j;
j = buf[14]; buf[14] = buf[6]; buf[6] = j;
} /* aes_shiftRows */
/* -------------------------------------------------------------------------- */
void aes_shiftRows_inv(uint8_t *buf)
{
register uint8_t i, j; /* same as above :) */
i = buf[1]; buf[1] = buf[13]; buf[13] = buf[9]; buf[9] = buf[5]; buf[5] = i;
i = buf[2]; buf[2] = buf[10]; buf[10] = i;
j = buf[3]; buf[3] = buf[7]; buf[7] = buf[11]; buf[11] = buf[15]; buf[15] = j;
j = buf[6]; buf[6] = buf[14]; buf[14] = j;
} /* aes_shiftRows_inv */
/* -------------------------------------------------------------------------- */
void aes_mixColumns(uint8_t *buf)
{
register uint8_t i, a, b, c, d, e;
for (i = 0; i < 16; i += 4)
{
a = buf[i]; b = buf[i + 1]; c = buf[i + 2]; d = buf[i + 3];
e = a ^ b ^ c ^ d;
buf[i] ^= e ^ rj_xtime(a^b); buf[i+1] ^= e ^ rj_xtime(b^c);
buf[i+2] ^= e ^ rj_xtime(c^d); buf[i+3] ^= e ^ rj_xtime(d^a);
}
} /* aes_mixColumns */
/* -------------------------------------------------------------------------- */
void aes_mixColumns_inv(uint8_t *buf)
{
register uint8_t i, a, b, c, d, e, x, y, z;
for (i = 0; i < 16; i += 4)
{
a = buf[i]; b = buf[i + 1]; c = buf[i + 2]; d = buf[i + 3];
e = a ^ b ^ c ^ d;
z = rj_xtime(e);
x = e ^ rj_xtime(rj_xtime(z^a^c)); y = e ^ rj_xtime(rj_xtime(z^b^d));
buf[i] ^= x ^ rj_xtime(a^b); buf[i+1] ^= y ^ rj_xtime(b^c);
buf[i+2] ^= x ^ rj_xtime(c^d); buf[i+3] ^= y ^ rj_xtime(d^a);
}
} /* aes_mixColumns_inv */
/* -------------------------------------------------------------------------- */
void aes_expandEncKey(uint8_t *k, uint8_t *rc)
{
register uint8_t i;
k[0] ^= rj_sbox(k[29]) ^ (*rc);
k[1] ^= rj_sbox(k[30]);
k[2] ^= rj_sbox(k[31]);
k[3] ^= rj_sbox(k[28]);
*rc = F( *rc);
for(i = 4; i < 16; i += 4) k[i] ^= k[i-4], k[i+1] ^= k[i-3],
k[i+2] ^= k[i-2], k[i+3] ^= k[i-1];
k[16] ^= rj_sbox(k[12]);
k[17] ^= rj_sbox(k[13]);
k[18] ^= rj_sbox(k[14]);
k[19] ^= rj_sbox(k[15]);
for(i = 20; i < 32; i += 4) k[i] ^= k[i-4], k[i+1] ^= k[i-3],
k[i+2] ^= k[i-2], k[i+3] ^= k[i-1];
} /* aes_expandEncKey */
/* -------------------------------------------------------------------------- */
void aes_expandDecKey(uint8_t *k, uint8_t *rc)
{
uint8_t i;
for(i = 28; i > 16; i -= 4) k[i+0] ^= k[i-4], k[i+1] ^= k[i-3],
k[i+2] ^= k[i-2], k[i+3] ^= k[i-1];
k[16] ^= rj_sbox(k[12]);
k[17] ^= rj_sbox(k[13]);
k[18] ^= rj_sbox(k[14]);
k[19] ^= rj_sbox(k[15]);
for(i = 12; i > 0; i -= 4) k[i+0] ^= k[i-4], k[i+1] ^= k[i-3],
k[i+2] ^= k[i-2], k[i+3] ^= k[i-1];
*rc = FD(*rc);
k[0] ^= rj_sbox(k[29]) ^ (*rc);
k[1] ^= rj_sbox(k[30]);
k[2] ^= rj_sbox(k[31]);
k[3] ^= rj_sbox(k[28]);
} /* aes_expandDecKey */
/* -------------------------------------------------------------------------- */
void aes256_init(aes256_context *ctx, uint8_t *k)
{
uint8_t rcon = 1;
register uint8_t i;
for (i = 0; i < sizeof(ctx->key); i++) ctx->enckey[i] = ctx->deckey[i] = k[i];
for (i = 8;--i;) aes_expandEncKey(ctx->deckey, &rcon);
} /* aes256_init */
/* -------------------------------------------------------------------------- */
void aes256_done(aes256_context *ctx)
{
register uint8_t i;
for (i = 0; i < sizeof(ctx->key); i++)
ctx->key[i] = ctx->enckey[i] = ctx->deckey[i] = 0;
} /* aes256_done */
/* -------------------------------------------------------------------------- */
void aes256_encrypt_ecb(aes256_context *ctx, uint8_t *buf)
{
uint8_t i, rcon;
aes_addRoundKey_cpy(buf, ctx->enckey, ctx->key);
for(i = 1, rcon = 1; i < 14; ++i)
{
aes_subBytes(buf);
aes_shiftRows(buf);
aes_mixColumns(buf);
if( i & 1 ) aes_addRoundKey( buf, &ctx->key[16]);
else aes_expandEncKey(ctx->key, &rcon), aes_addRoundKey(buf, ctx->key);
}
aes_subBytes(buf);
aes_shiftRows(buf);
aes_expandEncKey(ctx->key, &rcon);
aes_addRoundKey(buf, ctx->key);
} /* aes256_encrypt */
/* -------------------------------------------------------------------------- */
void aes256_decrypt_ecb(aes256_context *ctx, uint8_t *buf)
{
uint8_t i, rcon;
aes_addRoundKey_cpy(buf, ctx->deckey, ctx->key);
aes_shiftRows_inv(buf);
aes_subBytes_inv(buf);
for (i = 14, rcon = 0x80; --i;)
{
if( ( i & 1 ) )
{
aes_expandDecKey(ctx->key, &rcon);
aes_addRoundKey(buf, &ctx->key[16]);
}
else aes_addRoundKey(buf, ctx->key);
aes_mixColumns_inv(buf);
aes_shiftRows_inv(buf);
aes_subBytes_inv(buf);
}
aes_addRoundKey( buf, ctx->key);
} /* aes256_decrypt */
+42
View File
@@ -0,0 +1,42 @@
/*
* Byte-oriented AES-256 implementation.
* All lookup tables replaced with 'on the fly' calculations.
*
* Copyright (c) 2007-2009 Ilya O. Levin, http://www.literatecode.com
* Other contributors: Hal Finney
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
#ifndef uint8_t
#define uint8_t unsigned char
#endif
#ifdef __cplusplus
extern "C" {
#endif
typedef struct {
uint8_t key[32];
uint8_t enckey[32];
uint8_t deckey[32];
} aes256_context;
void aes256_init(aes256_context *, uint8_t * /* key */);
void aes256_done(aes256_context *);
void aes256_encrypt_ecb(aes256_context *, uint8_t * /* plaintext */);
void aes256_decrypt_ecb(aes256_context *, uint8_t * /* cipertext */);
#ifdef __cplusplus
}
#endif
+76
View File
@@ -0,0 +1,76 @@
/*
* Byte-oriented AES-256 implementation.
* All lookup tables replaced with 'on the fly' calculations.
*
* Copyright (c) 2007 Ilya O. Levin, http://www.literatecode.com
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
#include <stdlib.h>
#include <stdio.h>
#include <time.h>
#include <sys/times.h>
#include <sys/time.h>
#include "aes256.h"
#ifndef NUM_BLOCKS
#define NUM_BLOCKS 10000
#endif
#define DUMP(s, i, buf, sz) {printf(s); \
for (i = 0; i < (sz);i++) \
printf("%02x ", buf[i]); \
printf("\n");}
int main (int argc, char *argv[])
{
aes256_context ctx;
uint8_t key[32];
uint8_t buf[16], i;
long start, end, j;
/* put a test vector */
for (i = 0; i < sizeof(buf);i++) buf[i] = i * 16 + i;
for (i = 0; i < sizeof(key);i++) key[i] = i;
DUMP("txt: ", i, buf, sizeof(buf));
DUMP("key: ", i, key, sizeof(key));
printf("---\n");
aes256_init(&ctx, key);
start = clock();
for (j=0; j < NUM_BLOCKS; j++)
{
aes256_encrypt_ecb(&ctx, buf);
}
end = clock();
DUMP("enc: ", i, buf, sizeof(buf));
printf("Speed %f blocks/s\n", (float)j/((float)(end-start)/CLOCKS_PER_SEC));
aes256_init(&ctx, key);
start = clock();
for (j=0; j < NUM_BLOCKS; j++)
{
aes256_decrypt_ecb(&ctx, buf);
}
end = clock();
DUMP("dec: ", i, buf, sizeof(buf));
printf("Speed %f blocks/s\n", (float)j/((float)(end-start)/CLOCKS_PER_SEC));
aes256_done(&ctx);
return 0;
} /* main */
+358
View File
@@ -0,0 +1,358 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <time.h>
#include <sys/times.h>
#include <sys/time.h>
#define CPU_FREQ_HZ 100000000
#include "libsys.h"
#include "irq.h"
UINT32 buffer[16384];
#define T_SAMPLE 5000
#define TIMEOUT 1000
typedef struct _bar_t
{
UINT32 T;
UINT32 black;
} bar_t;
enum
{
state_idle = 0,
state_sample,
state_finish
};
typedef struct _sbar_cand_t
{
UINT32 T;
UINT32 is_primitive;
} bar_cand_t;
bar_t bars[1024];
void bsort(float *pData, UINT32 len)
{
float t;
int i, j;
for(i=len-1; i>=0; i--)
{
for(j=1; j<len; j++)
{
if (pData[j-1] > pData[j])
{
t = pData[j-1];
pData[j-1] = pData[j];
pData[j] = t;
}
}
}
}
typedef struct _smedian_t
{
UINT32 N;
UINT32 is_dirty;
float *pBuf, *pSorted;
UINT32 w;
float median;
} median_t;
void Median_init(median_t *pObj, UINT32 N, float init_val)
{
int i;
pObj->pBuf = (float*)malloc(N*sizeof(float));
pObj->pSorted = (float*)malloc(N*sizeof(float));
for (i=0; i < N; i++)
pObj->pBuf[0] = init_val;
pObj->median = init_val;
pObj->is_dirty = 0;
pObj->w = 0;
pObj->N = N;
}
void Median_free(median_t *pObj)
{
if (pObj->pBuf)
free(pObj->pBuf);
if (pObj->pSorted)
free(pObj->pSorted);
pObj->pBuf = NULL;
pObj->pSorted = NULL;
}
void Median_value_add(median_t *pObj, float value)
{
pObj->is_dirty = 1;
pObj->pBuf[pObj->w++] = value;
if (pObj->w == pObj->N)
pObj->w = 0;
}
float Median_get(median_t *pObj)
{
if (!pObj->is_dirty)
return pObj->median;
memcpy(pObj->pSorted, pObj->pBuf, pObj->N*sizeof(float));
bsort(pObj->pSorted, pObj->N);
if (pObj->N&1)
{
pObj->median = pObj->pSorted[(pObj->N-1)/2];
}
else
{
pObj->median = 0.5f*(pObj->pSorted[pObj->N/2] + pObj->pSorted[pObj->N/2+1]);
}
pObj->is_dirty = 0;
return pObj->median;
}
// -------------------------------------------------------------
UINT32 detect_module(UINT32 T, UINT32 T0)
{
UINT32 m, best_M;
float err, kc, best_err;
best_err = 4.f;
best_M = 0;
for (m=1; m < 5; m++)
{
kc = (float)T/(m*T0);
err = fabs(kc - 1);
if (err < best_err)
{
best_M = m;
best_err = err;
}
}
return best_M;
}
void handler7(void)
{
UINT32 volatile *pTim_ctrl = (UINT32*)SYS_ITIM_CTRL;
UINT32 volatile *pTim_stat = (UINT32*)SYS_ITIM_STAT;
UINT32 volatile *pPS20_stat = (UINT32*)SYS_PS2_0_STAT;
UINT32 volatile *pPS21_stat = (UINT32*)SYS_PS2_1_STAT;
static UINT32 state, bar_count;
static UINT32 timeout_count, timeout_reload;
static UINT32 white, pin_last, skip, start;
static UINT32 module_cnt_w, module_cnt_b, Tmod0_w, Tmod0_b, M, T0;
float ratio, error, kc;
UINT32 i;
static median_t med_b, med_w;
static bar_cand_t bc_b, bc_w;
static median_t speed_b, speed_w;
if (*pTim_stat & 1)
{
*pTim_stat = 1;
white = ((*pPS20_stat & SYS_PS2_BIT_PIN_DATA) == 0);
switch (state)
{
case state_idle:
timeout_reload = TIMEOUT;
if (white != pin_last)
{
if (white)
break;
state = state_sample;
module_cnt_b = 0;
module_cnt_w = 0;
Tmod0_w = 0xFFFFFFFF;
Tmod0_b = 0xFFFFFFFF;
bar_count = 0;
Median_init(&med_b, 3, 0);
Median_init(&med_w, 3, 0);
Median_init(&speed_b, 3, 1);
Median_init(&speed_w, 3, 1);
}
break;
case state_sample:
if (!timeout_count)
{
state = state_finish;
break;
}
if (white)
{
module_cnt_w++;
}
else
{
module_cnt_b++;
}
if (white != pin_last)
{
if (pin_last)
{
if (bar_count < 10)
{
if (1.5*module_cnt_w < Tmod0_w)
{
Tmod0_w = module_cnt_w;
}
}
Median_value_add(&med_w, Tmod0_w);
timeout_reload = 10*Tmod0_w;
bars[bar_count].T = module_cnt_w;
bars[bar_count].black = 0;
module_cnt_w = 0;
}
else
{
if (bar_count < 10)
{
if (1.5*module_cnt_b < Tmod0_b)
{
Tmod0_b = module_cnt_b;
}
}
Median_value_add(&med_b, Tmod0_b);
timeout_reload = 10*Tmod0_b;
bars[bar_count].T = module_cnt_b;
bars[bar_count].black = 1;
module_cnt_b = 0;
}
bar_count++;
}
break;
case state_finish:
printf("------------------------------------------------\n");
printf(" Black White \n");
skip = 0;
start = 1;
Tmod0_w = Median_get(&med_w);
Tmod0_b = Median_get(&med_b);
for (i=0; i < bar_count; i++)
{
if (bars[i].black)
{
T0 = Median_get(&med_b);
ratio = (float)bars[i].T/T0;
if (start)
{
if (ratio > 4)
{
skip = 1;
continue;
}
}
start = 0;
skip = 0;
M = detect_module(bars[i].T, T0);
kc = (float)bars[i].T/(M*T0);
error = kc - 1;
// printf("M=%d, R=%2.2f, E=%+2.2f [%04d]", M, ratio, error, T0);
// if (M == 1)
Median_value_add(&med_b, (UINT32)(T0*kc));
Median_value_add(&speed_b, (float)bars[i].T/(M*Tmod0_b));
printf("%06d %2.6f ", bars[i].T, Median_get(&speed_b));
}
else
{
if (skip)
continue;
T0 = Median_get(&med_w);
ratio = (float)bars[i].T/T0;
if (ratio > 9)
{
start = 1;
// printf("\n");
// printf("------------------------------------------------\n");
// printf(" Black White \n");
continue;
}
M = detect_module(bars[i].T, T0);
kc = (float)bars[i].T/(M*T0);
error = kc - 1;
// printf(" M=%d, R=%2.2f, E=%+2.2f [%04d]", M, ratio, error, T0);
// if (M == 1)
Median_value_add(&med_w, (UINT32)(T0*kc));
Median_value_add(&speed_w, (float)bars[i].T/(M*Tmod0_w));
printf("%06d %2.6f ", bars[i].T, Median_get(&speed_w));
printf("\n");
}
}
Median_free(&med_b);
Median_free(&med_w);
Median_free(&speed_b);
Median_free(&speed_w);
if (bar_count)
printf("\n");
state = state_idle;
break;
}
if (white != pin_last)
timeout_count = timeout_reload;
pin_last = white;
if (timeout_count)
timeout_count--;
}
}
int main(void)
{
int i;
UINT32 volatile *pTim_ctrl = (UINT32*)SYS_ITIM_CTRL;
UINT32 volatile *pTim_stat = (UINT32*)SYS_ITIM_STAT;
UINT32 volatile *pTim0_cnt = (UINT32*)SYS_ITIM0_CNT;
UINT32 volatile *pTim0_cmp = (UINT32*)SYS_ITIM0_CMP;
*pTim0_cnt = 0;
*pTim0_cmp = (UINT32)T_SAMPLE;
*pTim_stat = 1;
*pTim_ctrl = 3;
interrupt_register(7, (void*)handler7);
printf("Jenners BarCoder\n");
interrupt_enable(7);
while(1)
{
}
return 0;
}
+322
View File
@@ -0,0 +1,322 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <time.h>
#include <sys/times.h>
#include <sys/time.h>
#define CPU_FREQ_HZ 100000000
#include "libsys.h"
#include "irq.h"
UINT32 buffer[16384];
#define T_SAMPLE 5000
#define TIMEOUT 1000
typedef struct _bar_t
{
UINT32 T;
UINT32 black;
} bar_t;
enum
{
state_idle = 0,
state_sample,
state_finish
};
bar_t bars[1024];
void bsort(float *pData, UINT32 len)
{
float t;
int i, j;
for(i=len-1; i>=0; i--)
{
for(j=1; j<len; j++)
{
if (pData[j-1] > pData[j])
{
t = pData[j-1];
pData[j-1] = pData[j];
pData[j] = t;
}
}
}
}
typedef struct _smedian_t
{
UINT32 N;
UINT32 is_dirty;
float *pBuf, *pSorted;
UINT32 w;
float median;
} median_t;
void Median_init(median_t *pObj, UINT32 N, float init_val)
{
int i;
pObj->pBuf = (float*)malloc(N*sizeof(float));
pObj->pSorted = (float*)malloc(N*sizeof(float));
for (i=0; i < N; i++)
pObj->pBuf[0] = init_val;
pObj->median = init_val;
pObj->is_dirty = 0;
pObj->w = 0;
pObj->N = N;
}
void Median_free(median_t *pObj)
{
if (pObj->pBuf)
free(pObj->pBuf);
if (pObj->pSorted)
free(pObj->pSorted);
pObj->pBuf = NULL;
pObj->pSorted = NULL;
}
void Median_value_add(median_t *pObj, float value)
{
pObj->is_dirty = 1;
pObj->pBuf[pObj->w++] = value;
if (pObj->w == pObj->N)
pObj->w = 0;
}
float Median_get(median_t *pObj)
{
if (!pObj->is_dirty)
return pObj->median;
memcpy(pObj->pSorted, pObj->pBuf, pObj->N*sizeof(float));
bsort(pObj->pSorted, pObj->N);
if (pObj->N&1)
{
pObj->median = pObj->pSorted[(pObj->N-1)/2];
}
else
{
pObj->median = 0.5f*(pObj->pSorted[pObj->N/2] + pObj->pSorted[pObj->N/2+1]);
}
pObj->is_dirty = 0;
return pObj->median;
}
// -------------------------------------------------------------
UINT32 detect_module(UINT32 T, UINT32 *pBC)
{
UINT32 m, best_M;
float err, kc, best_err;
best_err = 4.f;
best_M = 0;
for (m=0; m < 4; m++)
{
kc = (float)T/pBC[m];
err = fabs(kc - 1);
if (err < best_err)
{
best_M = m+1;
best_err = err;
}
}
return best_M;
}
void handler7(void)
{
UINT32 volatile *pTim_ctrl = (UINT32*)SYS_ITIM_CTRL;
UINT32 volatile *pTim_stat = (UINT32*)SYS_ITIM_STAT;
UINT32 volatile *pPS20_stat = (UINT32*)SYS_PS2_0_STAT;
UINT32 volatile *pPS21_stat = (UINT32*)SYS_PS2_1_STAT;
static UINT32 state, bar_count;
static UINT32 timeout_count, timeout_reload;
static UINT32 white, pin_last, skip, start;
static UINT32 module_cnt_w, module_cnt_b, Tmod0_w, Tmod0_b, M, T0;
float ratio, error, kc;
UINT32 i, j;
static median_t med_b, med_w;
static UINT32 bc_b[4], bc_w[4];
if (*pTim_stat & 1)
{
*pTim_stat = 1;
white = ((*pPS20_stat & SYS_PS2_BIT_PIN_DATA) == 0);
switch (state)
{
case state_idle:
timeout_reload = TIMEOUT;
if (white != pin_last)
{
if (white)
break;
state = state_sample;
module_cnt_b = 0;
module_cnt_w = 0;
Tmod0_w = 0xFFFFFFFF;
Tmod0_b = 0xFFFFFFFF;
bar_count = 0;
Median_init(&med_b, 3, 1);
Median_init(&med_w, 3, 1);
}
break;
case state_sample:
if (!timeout_count)
{
state = state_finish;
break;
}
if (white)
{
module_cnt_w++;
}
else
{
module_cnt_b++;
}
if (white != pin_last)
{
if (pin_last)
{
if (bar_count < 10)
{
if (1.5*module_cnt_w < Tmod0_w)
{
Tmod0_w = module_cnt_w;
}
}
timeout_reload = 10*Tmod0_w;
bars[bar_count].T = module_cnt_w;
bars[bar_count].black = 0;
module_cnt_w = 0;
}
else
{
if (bar_count < 10)
{
if (1.5*module_cnt_b < Tmod0_b)
{
Tmod0_b = module_cnt_b;
}
}
timeout_reload = 10*Tmod0_b;
bars[bar_count].T = module_cnt_b;
bars[bar_count].black = 1;
module_cnt_b = 0;
}
bar_count++;
}
break;
case state_finish:
printf("------------------------------------------------\n");
printf(" Black White \n");
skip = 0;
start = 1;
for (i=0; i < 4; i++)
{
bc_b[i] = (i+1)*Tmod0_b;
bc_w[i] = (i+1)*Tmod0_w;
}
for (i=0; i < bar_count; i++)
{
if (bars[i].black)
{
M = detect_module(bars[i].T, bc_b);
if (M)
{
kc = (float)bars[i].T/bc_b[M-1];
error = kc - 1;
Median_value_add(&med_b, kc);
printf("M=%d, R=%2.2f, E=%+2.2f [%04d]", M, kc, error, bc_b[M-1]);
kc = Median_get(&med_b);
bc_b[M-1] = (UINT32)(kc*bc_b[M-1]);
}
// printf("%d", M);
}
else
{
M = detect_module(bars[i].T, bc_w);
if (M)
{
kc = (float)bars[i].T/bc_w[M-1];
error = kc - 1;
Median_value_add(&med_w, kc);
printf(" M=%d, R=%2.2f, E=%+2.2f [%04d]", M, kc, error, bc_w[M-1]);
kc = Median_get(&med_w);
bc_w[M-1] = (UINT32)(kc*bc_w[M-1]);
}
// printf("%d", M);
printf("\n");
}
}
Median_free(&med_b);
Median_free(&med_w);
if (bar_count)
printf("\n");
state = state_idle;
break;
}
if (white != pin_last)
timeout_count = timeout_reload;
pin_last = white;
if (timeout_count)
timeout_count--;
}
}
int main(void)
{
int i;
UINT32 volatile *pTim_ctrl = (UINT32*)SYS_ITIM_CTRL;
UINT32 volatile *pTim_stat = (UINT32*)SYS_ITIM_STAT;
UINT32 volatile *pTim0_cnt = (UINT32*)SYS_ITIM0_CNT;
UINT32 volatile *pTim0_cmp = (UINT32*)SYS_ITIM0_CMP;
*pTim0_cnt = 0;
*pTim0_cmp = (UINT32)T_SAMPLE;
*pTim_stat = 1;
*pTim_ctrl = 3;
interrupt_register(7, (void*)handler7);
printf("Jenners BarCoder\n");
interrupt_enable(7);
while(1)
{
}
return 0;
}
@@ -0,0 +1,84 @@
#include "snipmath.h"
#include <math.h>
/* The printf's may be removed to isolate just the math calculations */
int main(void)
{
double a1 = 1.0, b1 = -10.5, c1 = 32.0, d1 = -30.0;
double a2 = 1.0, b2 = -4.5, c2 = 17.0, d2 = -30.0;
double a3 = 1.0, b3 = -3.5, c3 = 22.0, d3 = -31.0;
double a4 = 1.0, b4 = -13.7, c4 = 1.0, d4 = -35.0;
double x[3];
double X;
int solutions;
int i;
unsigned long l = 0x3fed0169L;
struct int_sqrt q;
long n = 0;
/* solve soem cubic functions */
printf("********* CUBIC FUNCTIONS ***********\n");
/* should get 3 solutions: 2, 6 & 2.5 */
SolveCubic(a1, b1, c1, d1, &solutions, x);
printf("Solutions:");
for(i=0;i<solutions;i++)
printf(" %f",x[i]);
printf("\n");
/* should get 1 solution: 2.5 */
SolveCubic(a2, b2, c2, d2, &solutions, x);
printf("Solutions:");
for(i=0;i<solutions;i++)
printf(" %f",x[i]);
printf("\n");
SolveCubic(a3, b3, c3, d3, &solutions, x);
printf("Solutions:");
for(i=0;i<solutions;i++)
printf(" %f",x[i]);
printf("\n");
SolveCubic(a4, b4, c4, d4, &solutions, x);
printf("Solutions:");
for(i=0;i<solutions;i++)
printf(" %f",x[i]);
printf("\n");
/* Now solve some random equations */
for(a1=1;a1<10;a1++) {
for(b1=10;b1>0;b1--) {
for(c1=5;c1<15;c1+=0.5) {
for(d1=-1;d1>-11;d1--) {
SolveCubic(a1, b1, c1, d1, &solutions, x);
printf("Solutions:");
for(i=0;i<solutions;i++)
printf(" %f",x[i]);
printf("\n");
}
}
}
}
printf("********* INTEGER SQR ROOTS ***********\n");
/* perform some integer square roots */
for (i = 0; i < 1001; ++i)
{
usqrt(i, &q);
// remainder differs on some machines
// printf("sqrt(%3d) = %2d, remainder = %2d\n",
printf("sqrt(%3d) = %2d\n",
i, q.sqrt);
}
usqrt(l, &q);
//printf("\nsqrt(%lX) = %X, remainder = %X\n", l, q.sqrt, q.frac);
printf("\nsqrt(%lX) = %X\n", l, q.sqrt);
printf("********* ANGLE CONVERSION ***********\n");
/* convert some rads to degrees */
for (X = 0.0; X <= 360.0; X += 1.0)
printf("%3.0f degrees = %.12f radians\n", X, deg2rad(X));
puts("");
for (X = 0.0; X <= (2 * PI + 1e-6); X += (PI / 180))
printf("%.12f radians = %3.0f degrees\n", X, rad2deg(X));
return 0;
}
+71
View File
@@ -0,0 +1,71 @@
/*
* bogomips.c -- Program to measure bogomips... this program will probably go
* totally wacky with cpufreq enabled.
*
* Copyright (C) 2005 Darrick Wong.
*/
#include <stdio.h>
#include <time.h>
/* this should be approx 2 Bo*oMips to start (note initial shift), and will
* still work even if initially too large, it will just take slightly longer */
unsigned long loops_per_jiffy = (1<<12);
/* This is the number of bits of precision for the loops_per_jiffy. Each
* bit takes on average 1.5/HZ seconds. This (like the original) is a little
* better than 1% */
#define LPS_PREC 8
extern void delay(unsigned int loops);
//plagiarized straight from the 2.4 sources.
#ifdef NOMAIN
int calibrate_delay(void)
#else
int main(void)
#endif
{
unsigned long ticks, loopbit;
int lps_precision = LPS_PREC;
loops_per_jiffy = (1<<12);
printf("Calibrating delay loop... ");
while (loops_per_jiffy <<= 1) {
/* wait for "start of" clock tick */
ticks = clock();
while (ticks == clock())
/* nothing */;
/* Go .. */
ticks = clock();
delay(loops_per_jiffy);
ticks = clock() - ticks;
if (ticks)
break;
}
/* Do a binary approximation to get loops_per_jiffy set to equal one clock
(up to lps_precision bits) */
loops_per_jiffy >>= 1;
loopbit = loops_per_jiffy;
while ( lps_precision-- && (loopbit >>= 1) ) {
loops_per_jiffy |= loopbit;
ticks = clock();
while (ticks == clock());
ticks = clock();
delay(loops_per_jiffy);
if (clock() != ticks) /* longer than 1 tick */
loops_per_jiffy &= ~loopbit;
}
/* Round the value and print it */
printf("%lu.%02lu BogoMIPS\n",
loops_per_jiffy/(500000/HZ),
(loops_per_jiffy/(5000/HZ)) % 100);
return loops_per_jiffy;
}
+415
View File
@@ -0,0 +1,415 @@
#include <stdio.h>
#include <stdlib.h>
#include "libsys.h"
#include "cfiflash.h"
UINT32 cfi_get_status(flash_t *pObj)
{
volatile UINT32 *pF;
UINT32 status;
pF = (UINT32*)pObj->pBase;
*pF = 0x00700070;
status = *pF;
*pF = 0x00FF00FF;
return status;
}
void cfi_init(flash_t *pObj, UINT32 base_addr)
{
int i;
UINT8 *pInfo;
UINT32 endian;
UINT8 *pEndian;
pObj->pBase = (void*)base_addr;
pInfo = (UINT8*)&pObj->info;
for (i=0; i < sizeof(flash_info_t); i++)
{
pInfo[i] = 0;
}
pObj->eb = 0;
endian = 0x12345678;
pEndian = (UINT8*)&endian;
if (*pEndian == 0x12)
{
pObj->eb = 1;
}
}
UINT32 cfi_find(flash_t *pObj)
{
int i;
volatile UINT32 *pF;
volatile UINT16 *pF16;
// UINT8 qry_ref[12] = {0x51, 0x00, 0x51, 0x00, 0x52, 0x00, 0x52, 0x00, 0x59, 0x00, 0x59, 0x00};
UINT32 size;
pF = (UINT32*)pObj->pBase;
pF16 = (UINT16*)pObj->pBase;
// Look for flash
*pF = 0x00980098;
// for (i=0; i < sizeof(qry_ref); i++)
// if (((UINT8*)(&pF[0x10]))[i] != qry_ref[i])
// return (UINT32)-1;
*pF = 0x00FF00FF;
*pF = 0x00900090;
/*
printf("ManID : %8.8X\n", (UINT32)pF[0]);
printf("Device code : %8.8X\n", (UINT32)pF[1]);
printf("Block info : %8.8X\n", (UINT32)pF[2]);
printf("VCC(min) : %8.8X\n", (UINT32)pF[0x1B]);
printf("VCC(max) : %8.8X\n", (UINT32)pF[0x1C]);
printf("VPP(min) : %8.8X\n", (UINT32)pF[0x1D]);
printf("VPP(max) : %8.8X\n", (UINT32)pF[0x1E]);
printf("Device Layout : %8.8X\n", (UINT32)pF[0x27]);
printf("Interface type : %8.8X %8.8X\n", (UINT32)pF[0x28], (UINT32)pF[0x29]);
printf("Write buffer size : %8.8X %8.8X\n", (UINT32)pF[0x2A], (UINT32)pF[0x2B]);
printf("Num. erase blocks : %8.8X\n", (UINT32)pF[0x2C]);
printf("Erase block info : %8.8X %8.8X %8.8X %8.8X\n", (UINT32)pF[0x2D], (UINT32)pF[0x2E], (UINT32)pF[0x2F], (UINT32)pF[0x30]);
*/
pObj->info.num_flash = 2;
pObj->info.if_width = 32;
size = (UINT32)pF16[2*0x27];
pObj->info.flashsize = pObj->info.num_flash;
for (i=0; i < size; i++)
pObj->info.flashsize *= 2;
size = (UINT32)(pF16[2*0x2B] << 8 | pF16[2*0x2A]);
pObj->info.wbuf_size = pObj->info.num_flash;
for (i=0; i < size; i++)
pObj->info.wbuf_size *= 2;
pObj->info.nblocks = (UINT32)(pF16[2*0x2E] << 8 | pF16[2*0x2D]) + 1;
pObj->info.blocksize = pObj->info.num_flash * ((UINT32)(pF16[2*0x30] << 8 | pF16[2*0x2F]) * 256);
*pF = 0x00FF00FF;
return 0;
}
UINT32 cfi_block_is_locked(flash_t *pObj, UINT32 word_index)
{
volatile UINT32 *pF;
UINT32 status, block_index, block_mask;
UINT32 error;
pF = (UINT32*)pObj->pBase;
if (word_index >= (pObj->info.flashsize/4))
return CFI_ERR_INVPARAM;
block_mask = ((pObj->info.nblocks-1) << 16);
block_index = word_index & block_mask;
*pF = 0x00900090;
error = ((UINT32)pF[block_index+2] & 0x00010001) != 0;
*pF = 0x00FF00FF;
return error;
}
UINT32 cfi_block_erase(flash_t *pObj, UINT32 word_index)
{
volatile UINT32 *pF;
UINT32 status, block_index, block_mask;
UINT32 error;
pF = (UINT32*)pObj->pBase;
if (word_index >= (pObj->info.flashsize/4))
return CFI_ERR_INVPARAM;
block_mask = ((pObj->info.nblocks-1) << 16);
block_index = word_index & block_mask;
pF[block_index] = 0x00200020;
pF[block_index] = 0x00D000D0;
error = 0;
do
{
status = pF[block_index];
} while((status & SR_BIT_ISMS) != SR_BIT_ISMS);
if (status & (SR_BIT_ECLBS | SR_BIT_VPENS | SR_BIT_DPS))
{
error = CFI_ERR_DEV_FAIL | status;
}
pF[block_index] = 0x00FF00FF;
return error;
}
UINT32 cfi_block_lock(flash_t *pObj, UINT32 word_index)
{
volatile UINT32 *pF;
UINT32 status, block_index, block_mask;
UINT32 error;
pF = (UINT32*)pObj->pBase;
if (word_index >= (pObj->info.flashsize/4))
return CFI_ERR_INVPARAM;
block_mask = ((pObj->info.nblocks-1) << 16);
block_index = word_index & block_mask;
pF[block_index] = 0x00600060;
pF[block_index] = 0x00010001;
error = 0;
do
{
status = pF[block_index];
} while((status & SR_BIT_ISMS) != SR_BIT_ISMS);
if (status & (SR_BIT_PSLBS | SR_BIT_VPENS | SR_BIT_ECLBS))
{
error = CFI_ERR_DEV_FAIL | status;
}
pF[block_index] = 0x00FF00FF;
return error;
}
UINT32 cfi_block_unlock(flash_t *pObj, UINT32 word_index)
{
volatile UINT32 *pF;
UINT32 status, block_index, block_mask;
UINT32 error;
pF = (UINT32*)pObj->pBase;
if (word_index >= (pObj->info.flashsize/4))
return CFI_ERR_INVPARAM;
block_mask = ((pObj->info.nblocks-1) << 16);
block_index = word_index & block_mask;
pF[block_index] = 0x00600060;
pF[block_index] = 0x00D000D0;
error = 0;
do
{
status = pF[block_index];
} while((status & SR_BIT_ISMS) != SR_BIT_ISMS);
if (status & (SR_BIT_PSLBS | SR_BIT_VPENS | SR_BIT_ECLBS))
{
error = CFI_ERR_DEV_FAIL | status;
}
pF[block_index] = 0x00FF00FF;
return error;
}
UINT32 cfi_program_single(flash_t *pObj, UINT32 word_index, UINT32 word)
{
volatile UINT32 *pF;
UINT32 status, error;
pF = (UINT32*)pObj->pBase;
if (word_index >= (pObj->info.flashsize/4))
return CFI_ERR_INVPARAM;
pF[word_index] = 0x00400040;
pF[word_index] = word;
error = 0;
do
{
status = pF[word_index];
} while((status & SR_BIT_ISMS) != SR_BIT_ISMS);
if (status & (SR_BIT_PSLBS | SR_BIT_VPENS | SR_BIT_DPS))
{
error = CFI_ERR_DEV_FAIL | status;
}
pF[word_index] = 0x00FF00FF;
return error;
}
UINT32 cfi_program_multi(flash_t *pObj, UINT32 word_index, UINT32 *pWords, UINT32 num_words)
{
int i, j, k;
volatile UINT32 *pF;
UINT32 status, bcurr, bnext, block_mask, nblock_write, nbuf_write;
UINT32 error;
pF = (UINT32*)pObj->pBase;
if (word_index >= (pObj->info.flashsize/4))
return CFI_ERR_INVPARAM;
block_mask = ((pObj->info.nblocks-1) << 16);
k = 0;
while(num_words)
{
bcurr = word_index & block_mask;
bnext = bcurr + (1 << 16);
nblock_write = bnext - word_index;
if (nblock_write > num_words)
nblock_write = num_words;
while(nblock_write)
{
error = 0;
pF[bcurr] = 0x00E800E8;
do
{
status = pF[bcurr];
} while((status & SR_BIT_ISMS) != SR_BIT_ISMS);
if (status & (SR_BIT_PSLBS | SR_BIT_VPENS | SR_BIT_DPS))
{
error = CFI_ERR_DEV_FAIL | status;
break;
}
nbuf_write = nblock_write;
if (nblock_write > pObj->info.wbuf_size/4)
nbuf_write = pObj->info.wbuf_size/4;
pF[bcurr] = (nbuf_write-1) << 16 | (nbuf_write-1);
for (j=0; j < nbuf_write; j++)
pF[word_index+j] = pWords[k++];
word_index += j;
nblock_write -= j;
num_words -= j;
error = 0;
pF[bcurr] = 0x00D000D0;
do
{
status = pF[bcurr];
} while((status & SR_BIT_ISMS) != SR_BIT_ISMS);
if (status & (SR_BIT_PSLBS | SR_BIT_VPENS | SR_BIT_DPS))
{
error = CFI_ERR_DEV_FAIL | status;
break;
}
pF[bcurr] = 0x00FF00FF;
}
if (IS_ERROR(error))
{
pF[bcurr] = 0x00FF00FF;
break;
}
bcurr = bnext;
}
return error;
}
UINT32 flash_find(flash_t *pObj, UINT32 base_addr)
{
cfi_init(pObj, base_addr);
return cfi_find(pObj);
}
UINT32 flash_erase(flash_t *pObj, UINT32 offset, UINT32 size)
{
int i;
UINT32 offset_end, error;
if (size % 4)
size = 4*(size/4 + 1);
offset_end = offset + size;
for (i=offset; i < offset_end; i += pObj->info.blocksize)
{
if (cfi_block_is_locked(pObj, i/4))
{
error = cfi_block_unlock(pObj, i/4);
if (IS_ERROR(error))
break;
}
error = cfi_block_erase(pObj, i/4);
if (IS_ERROR(error))
break;
}
return error;
}
UINT32 flash_program(flash_t *pObj, UINT32 offset, UINT8 *pData, UINT32 size)
{
if (size % 4)
size = 4*(size/4 + 1);
return cfi_program_multi(pObj, offset/4, (UINT32*)pData, size/4);
}
UINT32 flash_verify(flash_t *pObj, UINT32 offset, UINT8 *pData, UINT32 size)
{
int i;
UINT8 *pF;
pF = (UINT8*)(pObj->pBase + offset);
for (i=0; i < size; i++)
if (pF[i] != pData[i])
return CFI_ERR_VFY_FAIL;
return 0;
}
UINT32 flash_get_blocknum_by_offset(flash_t *pObj, UINT32 offset)
{
UINT32 blocknum;
blocknum = offset/pObj->info.blocksize;
if (offset%pObj->info.blocksize)
blocknum++;
return blocknum;
}
UINT32 flash_get_offset_by_blocknum(flash_t *pObj, UINT32 blocknum)
{
if (blocknum >= pObj->info.nblocks)
blocknum = pObj->info.nblocks - 1;
return blocknum*pObj->info.blocksize;
}
UINT32 flash_get_offset_blockaligned(flash_t *pObj, UINT32 offset)
{
return flash_get_blocknum_by_offset(pObj, offset) * pObj->info.blocksize;
}
+58
View File
@@ -0,0 +1,58 @@
/************************************************************************/
#ifndef CFIFLASH_H
#define CFIFLASH_H
#include "libsys.h"
#define SR_BIT_DPS 0x00020002
#define SR_BIT_PSS 0x00040004
#define SR_BIT_VPENS 0x00080008
#define SR_BIT_PSLBS 0x00100010
#define SR_BIT_ECLBS 0x00200020
#define SR_BIT_ESS 0x00400040
#define SR_BIT_ISMS 0x00800080
#define CFI_ERR_BASE (LSYS_ERR_BASE + 0x00100000)
#define CFI_ERR_GENERAL (CFI_ERR_BASE + 0)
#define CFI_ERR_NOTFOUND (CFI_ERR_BASE + 1)
#define CFI_ERR_INVPARAM (CFI_ERR_BASE + 2)
#define CFI_ERR_VFY_FAIL (CFI_ERR_BASE + 3)
#define CFI_ERR_DEV_FAIL (CFI_ERR_BASE + 0x10000000)
typedef struct _sflash_info_t
{
UINT32 flashsize;
UINT32 blocksize;
UINT32 nblocks;
UINT32 wbuf_size;
UINT32 if_width;
UINT32 num_flash;
} flash_info_t;
typedef struct _sflash_t
{
void *pBase;
UINT32 eb;
flash_info_t info;
} flash_t;
void cfi_init(flash_t *pObj, UINT32 base_addr);
UINT32 cfi_find(flash_t *pObj);
UINT32 cfi_block_is_locked(flash_t *pObj, UINT32 word_index);
UINT32 cfi_block_erase(flash_t *pObj, UINT32 word_index);
UINT32 cfi_block_lock(flash_t *pObj, UINT32 word_index);
UINT32 cfi_block_unlock(flash_t *pObj, UINT32 word_index);
UINT32 cfi_program_single(flash_t *pObj, UINT32 word_index, UINT32 word);
UINT32 cfi_program_multi(flash_t *pObj, UINT32 word_index, UINT32 *pWords, UINT32 num_words);
UINT32 flash_get_offset_by_blocknum(flash_t *pObj, UINT32 blocknum);
UINT32 flash_get_blocknum_by_offset(flash_t *pObj, UINT32 offset);
UINT32 flash_get_offset_blockaligned(flash_t *pObj, UINT32 offset);
UINT32 flash_find(flash_t *pObj, UINT32 base_addr);
UINT32 flash_erase(flash_t *pObj, UINT32 offset, UINT32 size);
UINT32 flash_program(flash_t *pObj, UINT32 offset, UINT8 *pData, UINT32 size);
UINT32 flash_verify(flash_t *pObj, UINT32 offset, UINT8 *pData, UINT32 size);
#endif // CFIFLASH_H
+54
View File
@@ -0,0 +1,54 @@
#include <stdio.h>
unsigned long MakeCRC32(char *data, unsigned int len, unsigned int CRC)
{
/* ========================================================================
* Table of CRC-32's of all single-byte values (made by makecrc.c)
*/
unsigned long crc_32_tab[] = {
0x00000000L, 0x77073096L, 0xee0e612cL, 0x990951baL, 0x076dc419L, 0x706af48fL, 0xe963a535L, 0x9e6495a3L,
0x0edb8832L, 0x79dcb8a4L, 0xe0d5e91eL, 0x97d2d988L, 0x09b64c2bL, 0x7eb17cbdL, 0xe7b82d07L, 0x90bf1d91L,
0x1db71064L, 0x6ab020f2L, 0xf3b97148L, 0x84be41deL, 0x1adad47dL, 0x6ddde4ebL, 0xf4d4b551L, 0x83d385c7L,
0x136c9856L, 0x646ba8c0L, 0xfd62f97aL, 0x8a65c9ecL, 0x14015c4fL, 0x63066cd9L, 0xfa0f3d63L, 0x8d080df5L,
0x3b6e20c8L, 0x4c69105eL, 0xd56041e4L, 0xa2677172L, 0x3c03e4d1L, 0x4b04d447L, 0xd20d85fdL, 0xa50ab56bL,
0x35b5a8faL, 0x42b2986cL, 0xdbbbc9d6L, 0xacbcf940L, 0x32d86ce3L, 0x45df5c75L, 0xdcd60dcfL, 0xabd13d59L,
0x26d930acL, 0x51de003aL, 0xc8d75180L, 0xbfd06116L, 0x21b4f4b5L, 0x56b3c423L, 0xcfba9599L, 0xb8bda50fL,
0x2802b89eL, 0x5f058808L, 0xc60cd9b2L, 0xb10be924L, 0x2f6f7c87L, 0x58684c11L, 0xc1611dabL, 0xb6662d3dL,
0x76dc4190L, 0x01db7106L, 0x98d220bcL, 0xefd5102aL, 0x71b18589L, 0x06b6b51fL, 0x9fbfe4a5L, 0xe8b8d433L,
0x7807c9a2L, 0x0f00f934L, 0x9609a88eL, 0xe10e9818L, 0x7f6a0dbbL, 0x086d3d2dL, 0x91646c97L, 0xe6635c01L,
0x6b6b51f4L, 0x1c6c6162L, 0x856530d8L, 0xf262004eL, 0x6c0695edL, 0x1b01a57bL, 0x8208f4c1L, 0xf50fc457L,
0x65b0d9c6L, 0x12b7e950L, 0x8bbeb8eaL, 0xfcb9887cL, 0x62dd1ddfL, 0x15da2d49L, 0x8cd37cf3L, 0xfbd44c65L,
0x4db26158L, 0x3ab551ceL, 0xa3bc0074L, 0xd4bb30e2L, 0x4adfa541L, 0x3dd895d7L, 0xa4d1c46dL, 0xd3d6f4fbL,
0x4369e96aL, 0x346ed9fcL, 0xad678846L, 0xda60b8d0L, 0x44042d73L, 0x33031de5L, 0xaa0a4c5fL, 0xdd0d7cc9L,
0x5005713cL, 0x270241aaL, 0xbe0b1010L, 0xc90c2086L, 0x5768b525L, 0x206f85b3L, 0xb966d409L, 0xce61e49fL,
0x5edef90eL, 0x29d9c998L, 0xb0d09822L, 0xc7d7a8b4L, 0x59b33d17L, 0x2eb40d81L, 0xb7bd5c3bL, 0xc0ba6cadL,
0xedb88320L, 0x9abfb3b6L, 0x03b6e20cL, 0x74b1d29aL, 0xead54739L, 0x9dd277afL, 0x04db2615L, 0x73dc1683L,
0xe3630b12L, 0x94643b84L, 0x0d6d6a3eL, 0x7a6a5aa8L, 0xe40ecf0bL, 0x9309ff9dL, 0x0a00ae27L, 0x7d079eb1L,
0xf00f9344L, 0x8708a3d2L, 0x1e01f268L, 0x6906c2feL, 0xf762575dL, 0x806567cbL, 0x196c3671L, 0x6e6b06e7L,
0xfed41b76L, 0x89d32be0L, 0x10da7a5aL, 0x67dd4accL, 0xf9b9df6fL, 0x8ebeeff9L, 0x17b7be43L, 0x60b08ed5L,
0xd6d6a3e8L, 0xa1d1937eL, 0x38d8c2c4L, 0x4fdff252L, 0xd1bb67f1L, 0xa6bc5767L, 0x3fb506ddL, 0x48b2364bL,
0xd80d2bdaL, 0xaf0a1b4cL, 0x36034af6L, 0x41047a60L, 0xdf60efc3L, 0xa867df55L, 0x316e8eefL, 0x4669be79L,
0xcb61b38cL, 0xbc66831aL, 0x256fd2a0L, 0x5268e236L, 0xcc0c7795L, 0xbb0b4703L, 0x220216b9L, 0x5505262fL,
0xc5ba3bbeL, 0xb2bd0b28L, 0x2bb45a92L, 0x5cb36a04L, 0xc2d7ffa7L, 0xb5d0cf31L, 0x2cd99e8bL, 0x5bdeae1dL,
0x9b64c2b0L, 0xec63f226L, 0x756aa39cL, 0x026d930aL, 0x9c0906a9L, 0xeb0e363fL, 0x72076785L, 0x05005713L,
0x95bf4a82L, 0xe2b87a14L, 0x7bb12baeL, 0x0cb61b38L, 0x92d28e9bL, 0xe5d5be0dL, 0x7cdcefb7L, 0x0bdbdf21L,
0x86d3d2d4L, 0xf1d4e242L, 0x68ddb3f8L, 0x1fda836eL, 0x81be16cdL, 0xf6b9265bL, 0x6fb077e1L, 0x18b74777L,
0x88085ae6L, 0xff0f6a70L, 0x66063bcaL, 0x11010b5cL, 0x8f659effL, 0xf862ae69L, 0x616bffd3L, 0x166ccf45L,
0xa00ae278L, 0xd70dd2eeL, 0x4e048354L, 0x3903b3c2L, 0xa7672661L, 0xd06016f7L, 0x4969474dL, 0x3e6e77dbL,
0xaed16a4aL, 0xd9d65adcL, 0x40df0b66L, 0x37d83bf0L, 0xa9bcae53L, 0xdebb9ec5L, 0x47b2cf7fL, 0x30b5ffe9L,
0xbdbdf21cL, 0xcabac28aL, 0x53b39330L, 0x24b4a3a6L, 0xbad03605L, 0xcdd70693L, 0x54de5729L, 0x23d967bfL,
0xb3667a2eL, 0xc4614ab8L, 0x5d681b02L, 0x2a6f2b94L, 0xb40bbe37L, 0xc30c8ea1L, 0x5a05df1bL, 0x2d02ef8dL
};
if (data == NULL)
return 0;
CRC = ~CRC;
while (len --)
{
CRC = crc_32_tab[((unsigned char) CRC ^ *data) & 0xFF] ^ (CRC >> 8);
data ++;
}
return ~CRC;
}
+13
View File
@@ -0,0 +1,13 @@
// CRC32 function
// To create a CRC from a new buffer, use this:
// crc = MakeCRC32(mydata, data_len, 0);
// If you need to continue the CRC (e.g. your data is in multiple buffers),
// continue like this:
// crc = MakeCRC32(moredata, more_len, crc);
//
// Your desired CRC should be the complement of the CRC generated by
// MakeCRC32:
// desired = crc
// desired - crc = 0
unsigned long MakeCRC32(char *data, unsigned int len, unsigned long CRC);
+64
View File
@@ -0,0 +1,64 @@
/* +++Date last modified: 05-Jul-1997 */
/*
** CUBIC.C - Solve a cubic polynomial
** public domain by Ross Cottrell
*/
#include <math.h>
#include <stdlib.h>
#include "snipmath.h"
void SolveCubic(double a,
double b,
double c,
double d,
int *solutions,
double *x)
{
long double a1 = b/a, a2 = c/a, a3 = d/a;
long double Q = (a1*a1 - 3.0*a2)/9.0;
long double R = (2.0*a1*a1*a1 - 9.0*a1*a2 + 27.0*a3)/54.0;
double R2_Q3 = R*R - Q*Q*Q;
double theta;
if (R2_Q3 <= 0)
{
*solutions = 3;
theta = acos(R/sqrt(Q*Q*Q));
x[0] = -2.0*sqrt(Q)*cos(theta/3.0) - a1/3.0;
x[1] = -2.0*sqrt(Q)*cos((theta+2.0*PI)/3.0) - a1/3.0;
x[2] = -2.0*sqrt(Q)*cos((theta+4.0*PI)/3.0) - a1/3.0;
}
else
{
*solutions = 1;
x[0] = pow(sqrt(R2_Q3)+fabs(R), 1/3.0);
x[0] += Q/x[0];
x[0] *= (R < 0.0) ? 1 : -1;
x[0] -= a1/3.0;
}
}
#ifdef TEST
int main(void)
{
double a1 = 1.0, b1 = -10.5, c1 = 32.0, d1 = -30.0;
double a2 = 1.0, b2 = -4.5, c2 = 17.0, d2 = -30.0;
double x[3];
int solutions;
SolveCubic(a1, b1, c1, d1, &solutions, x);
/* should get 3 solutions: 2, 6 & 2.5 */
SolveCubic(a2, b2, c2, d2, &solutions, x);
/* should get 1 solution: 2.5 */
return 0;
}
#endif /* TEST */
+375
View File
@@ -0,0 +1,375 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "irq.h"
#include "libsys.h"
#include "mips_dis.h"
#define MAX_USER_BP 16
#define BP_MASK_ID 0x00FFF
#define BP_MASK_TYPE 0xFF000
#define BP_GET_ID(bp) ((bp >> 6) & 0xFFF)
#define BP_USER_BASE 0x10000
#define BP_USER(id) (((BP_USER_BASE + id) << 6) | 0x0D)
#define BP_MGMT_BASE_SS 0x20000
#define BP_MGMT_SS(id) (((BP_MGMT_BASE_SS + id) << 6) | 0x0D)
#define BP_MGMT_BASE_RU 0x30000
#define BP_MGMT_RU(id) (((BP_MGMT_BASE_RU + id) << 6) | 0x0D)
static char g_buf[80];
typedef struct _sbp_t
{
UINT32 *pAddr;
UINT32 instr;
} bp_t;
static EXCEPTION_CONTEXT xcp_last;
static bp_t user_bp[MAX_USER_BP];
static bp_t mgmt_bp_ss[2];
static bp_t mgmt_bp_ru[2];
static int g_is_ss;
static int g_bp_index;
int IsBreak(UINT32 instr)
{
return ((instr & 0xFC00003F) == 0x0000000D);
}
UINT32 BreakGetType(UINT32 instr)
{
return (instr >> 6) & BP_MASK_TYPE;
}
char* reg_changed(UINT32 reg1, UINT32 reg2)
{
static char chg_str[2] = {0};
if (reg1 != reg2)
chg_str[0] = '*';
else
chg_str[0] = ' ';
return chg_str;
}
void dbg_handler(struct xcptcontext * xcp)
{
UINT32 bp_addr, bp_index = 0, branch_addr, reg, result, bp_type;
int junk, i, leave_isr, is_branch_shadow, is_user_bp;
UINT32 volatile *pBtn = (UINT32*)SYS_GPIO0;
UINT32 *pInstr, *pAddr_curr, *pAddr_prev, *pAddr_next;
sputs("\n");
PRINT_REG_CHG(" Status : ", xcp->sr, reg_changed(xcp->sr, xcp_last.sr));
PRINT_REG_CHG(" Cause : ", xcp->cr, reg_changed(xcp->cr, xcp_last.cr));
PRINT_REG_CHG(" EPC : ", xcp->epc, reg_changed(xcp->epc, xcp_last.epc));
PRINT_REG_CHG("BadAddr : ", xcp->baddr, reg_changed(xcp->baddr, xcp_last.baddr));
sputs("\n");
PRINT_REG_CHG(" MDLO : ", xcp->mdlo, reg_changed(xcp->mdlo, xcp_last.mdlo));
PRINT_REG_CHG(" MDHI : ", xcp->mdhi, reg_changed(xcp->mdhi, xcp_last.mdhi));
sputs("\n");
sputs("Registers:\n");
PRINT_REG_CHG(" 0 (ze) : ", xcp->regs[0], reg_changed(xcp->regs[0], xcp_last.regs[0]));
PRINT_REG_CHG(" 1 (at) : ", xcp->regs[1], reg_changed(xcp->regs[1], xcp_last.regs[1]));
PRINT_REG_CHG(" 2 (v0) : ", xcp->regs[2], reg_changed(xcp->regs[2], xcp_last.regs[2]));
PRINT_REG_CHG(" 3 (v1) : ", xcp->regs[3], reg_changed(xcp->regs[3], xcp_last.regs[3]));
sputs("\n");
PRINT_REG_CHG(" 4 (a0) : ", xcp->regs[4], reg_changed(xcp->regs[4], xcp_last.regs[4]));
PRINT_REG_CHG(" 5 (a1) : ", xcp->regs[5], reg_changed(xcp->regs[5], xcp_last.regs[5]));
PRINT_REG_CHG(" 6 (a2) : ", xcp->regs[6], reg_changed(xcp->regs[6], xcp_last.regs[6]));
PRINT_REG_CHG(" 7 (a3) : ", xcp->regs[7], reg_changed(xcp->regs[7], xcp_last.regs[7]));
sputs("\n");
PRINT_REG_CHG(" 8 (t0) : ", xcp->regs[8], reg_changed(xcp->regs[8], xcp_last.regs[8]));
PRINT_REG_CHG(" 9 (t1) : ", xcp->regs[9], reg_changed(xcp->regs[9], xcp_last.regs[9]));
PRINT_REG_CHG("10 (t2) : ", xcp->regs[10], reg_changed(xcp->regs[10], xcp_last.regs[10]));
PRINT_REG_CHG("11 (t3) : ", xcp->regs[11], reg_changed(xcp->regs[11], xcp_last.regs[11]));
sputs("\n");
PRINT_REG_CHG("12 (t4) : ", xcp->regs[12], reg_changed(xcp->regs[12], xcp_last.regs[12]));
PRINT_REG_CHG("13 (t5) : ", xcp->regs[13], reg_changed(xcp->regs[13], xcp_last.regs[13]));
PRINT_REG_CHG("14 (t6) : ", xcp->regs[14], reg_changed(xcp->regs[14], xcp_last.regs[14]));
PRINT_REG_CHG("15 (t7) : ", xcp->regs[15], reg_changed(xcp->regs[15], xcp_last.regs[15]));
sputs("\n");
PRINT_REG_CHG("16 (s0) : ", xcp->regs[16], reg_changed(xcp->regs[16], xcp_last.regs[16]));
PRINT_REG_CHG("17 (s1) : ", xcp->regs[17], reg_changed(xcp->regs[17], xcp_last.regs[17]));
PRINT_REG_CHG("18 (s2) : ", xcp->regs[18], reg_changed(xcp->regs[18], xcp_last.regs[18]));
PRINT_REG_CHG("19 (s3) : ", xcp->regs[19], reg_changed(xcp->regs[19], xcp_last.regs[19]));
sputs("\n");
PRINT_REG_CHG("20 (s4) : ", xcp->regs[20], reg_changed(xcp->regs[20], xcp_last.regs[20]));
PRINT_REG_CHG("21 (s5) : ", xcp->regs[21], reg_changed(xcp->regs[21], xcp_last.regs[21]));
PRINT_REG_CHG("22 (s6) : ", xcp->regs[22], reg_changed(xcp->regs[22], xcp_last.regs[22]));
PRINT_REG_CHG("23 (s7) : ", xcp->regs[23], reg_changed(xcp->regs[23], xcp_last.regs[23]));
sputs("\n");
PRINT_REG_CHG("24 (s8) : ", xcp->regs[24], reg_changed(xcp->regs[24], xcp_last.regs[24]));
PRINT_REG_CHG("25 (s9) : ", xcp->regs[25], reg_changed(xcp->regs[25], xcp_last.regs[25]));
PRINT_REG_CHG("26 (k0) : ", xcp->regs[26], reg_changed(xcp->regs[26], xcp_last.regs[26]));
PRINT_REG_CHG("27 (k1) : ", xcp->regs[27], reg_changed(xcp->regs[27], xcp_last.regs[27]));
sputs("\n");
PRINT_REG_CHG("28 (gp) : ", xcp->regs[28], reg_changed(xcp->regs[28], xcp_last.regs[28]));
PRINT_REG_CHG("29 (sp) : ", xcp->regs[29], reg_changed(xcp->regs[29], xcp_last.regs[29]));
PRINT_REG_CHG("30 (fp) : ", xcp->regs[30], reg_changed(xcp->regs[30], xcp_last.regs[30]));
PRINT_REG_CHG("31 (ra) : ", xcp->regs[31], reg_changed(xcp->regs[31], xcp_last.regs[31]));
sputs("\n");
sputs("\n");
memcpy(&xcp_last, xcp, sizeof(EXCEPTION_CONTEXT));
is_user_bp = 0;
pAddr_curr = (UINT32*)xcp->epc;
is_branch_shadow = ((xcp->cr & 0x80000000) == 0x80000000);
if (is_branch_shadow)
pAddr_curr++;
pAddr_prev = pAddr_curr - 1;
pAddr_next = pAddr_curr + 1;
if (IsBreak(*pAddr_curr))
{
bp_type = BreakGetType(*pAddr_curr);
switch (bp_type)
{
case BP_MGMT_BASE_SS:
// Restore original instructions after single-step
// sputs("1. Restore after single-step at ");print_word((long)mgmt_bp_ss[0].pAddr);sputs("\n");
*(mgmt_bp_ss[0].pAddr) = mgmt_bp_ss[0].instr;
ICACHE_invalidate_at(mgmt_bp_ss[0].pAddr);
if (mgmt_bp_ss[1].pAddr)
{
// sputs("2. Restore after single-step at ");print_word((long)mgmt_bp_ss[1].pAddr);sputs("\n");
*(mgmt_bp_ss[1].pAddr) = mgmt_bp_ss[1].instr;
ICACHE_invalidate_at(mgmt_bp_ss[1].pAddr);
}
break;
case BP_MGMT_BASE_RU:
bp_index = BP_GET_ID(*pAddr_curr);
// sputs("Restore user break at ");print_word((long)user_bp[bp_index].pAddr);sputs("\n");
*(user_bp[bp_index].pAddr) = BP_USER(bp_index);
ICACHE_invalidate_at(user_bp[bp_index].pAddr);
*(mgmt_bp_ru[0].pAddr) = mgmt_bp_ru[0].instr;
ICACHE_invalidate_at(mgmt_bp_ru[0].pAddr);
// sputs("1. Restore after RU at ");print_word((long)mgmt_bp_ru[0].pAddr);sputs("\n");
if (mgmt_bp_ru[1].pAddr)
{
*(mgmt_bp_ru[1].pAddr) = mgmt_bp_ru[1].instr;
ICACHE_invalidate_at(mgmt_bp_ru[1].pAddr);
// sputs("2. Restore after RU at ");print_word((long)mgmt_bp_ru[1].pAddr);sputs("\n");
}
if (!g_is_ss)
return;
break;
case BP_USER_BASE:
is_user_bp = 1;
bp_index = BP_GET_ID(*pAddr_curr);
// sputs("Restore instruction at ");print_word((long)user_bp[bp_index].pAddr);sputs("\n");
*(user_bp[bp_index].pAddr) = user_bp[bp_index].instr;
ICACHE_invalidate_at(user_bp[bp_index].pAddr);
break;
default:
// sputs("Found ordinary break at ");print_word((long)pAddr_curr);sputs("\n");
break;
}
}
pInstr = pAddr_prev;
// Disassemble instructions
for (i=0; i < 3; i++)
{
print_word((long)pInstr);
if (IsBreak(*pInstr) && (BreakGetType(*pInstr) == BP_USER_BASE))
{
tdisasm(g_buf, (long)user_bp[BP_GET_ID(*pInstr)].pAddr, user_bp[BP_GET_ID(*pInstr)].instr, 0, &junk, &junk, &junk);
sputs(": b ");
}
else
{
tdisasm(g_buf, (long)pInstr, *pInstr, 0, &junk, &junk, &junk);
if (pInstr == pAddr_curr)
if (is_user_bp == 1)
sputs(": b-> ");
else
sputs(": -> ");
else
sputs(": ");
}
sputs(g_buf);
sputs("\n");
pInstr++;
}
if (is_user_bp)
{
// Save original instruction
mgmt_bp_ru[0].pAddr = pAddr_next;
mgmt_bp_ru[0].instr = *(mgmt_bp_ru[0].pAddr);
// Replace instruction with managment breakpoint
*(mgmt_bp_ru[0].pAddr) = BP_MGMT_RU(bp_index);
ICACHE_invalidate_at(mgmt_bp_ru[0].pAddr);
mgmt_bp_ru[1].pAddr = NULL;
mgmt_bp_ru[1].pAddr = 0;
// sputs("1. Insert RU-break at ");print_word((long)mgmt_bp_ru[0].pAddr);sputs("\n");
// We have two possible management breaks, if previous instruction was branch or jump
if (is_branch_shadow)
{
result = tdisasm(g_buf, (long)pAddr_prev, *pAddr_prev, 0, &junk, &branch_addr, &reg);
// Is jump target stored in register
if (result == 3)
{
branch_addr = xcp->regs[reg&0x1F];
}
// Save original instruction
mgmt_bp_ru[1].pAddr = (UINT32*)branch_addr;
mgmt_bp_ru[1].instr = *(mgmt_bp_ru[1].pAddr);
// Replace instruction with managment breakpoint
*(mgmt_bp_ru[1].pAddr) = BP_MGMT_RU(bp_index);
ICACHE_invalidate_at(mgmt_bp_ru[1].pAddr);
// sputs("2. Insert RU-break at ");print_word((long)mgmt_bp_ru[1].pAddr);sputs("\n");
}
}
do
{
leave_isr = 0;
switch(_getchar())
{
case 'g':
leave_isr = 1;
g_is_ss = 0;
if (IsBreak(*pAddr_curr))
{
if (BreakGetType(*pAddr_curr) != BP_USER_BASE)
{
xcp->epc += 4; // Skip ordinary program breaks
}
}
break;
case 'b':
printf("Enter breakpoint: ");
scanf("%x", &bp_addr);
printf("Insert breakpoint at %.8X\n", bp_addr);
user_bp[g_bp_index].pAddr = (UINT32*)bp_addr;
user_bp[g_bp_index].instr = *(user_bp[g_bp_index].pAddr);
*(user_bp[g_bp_index].pAddr) = BP_USER(g_bp_index);
tdisasm(g_buf, (long)user_bp[g_bp_index].pAddr, user_bp[g_bp_index].instr, 0, &junk, &junk, &junk);
print_word((long)user_bp[g_bp_index].pAddr);sputs(": b ");sputs(g_buf);sputs("\n");
ICACHE_invalidate_at(user_bp[g_bp_index].pAddr);
g_bp_index++;
break;
case 's':
g_is_ss = 1;
leave_isr = 1;
// Don't overwrite RU breaks
// printf("is_user_bp = %d, IsBreak = %d, pAddr_curr = %08X, *pAddr_curr = %08X\n", is_user_bp, IsBreak(*pAddr_curr), pAddr_curr, *pAddr_curr);
if (is_user_bp)
break;
// Don't overwrite user breaks
if (IsBreak(*pAddr_curr))
{
if (BreakGetType(*pAddr_curr) == BP_USER_BASE)
{
break;
}
else
{
xcp->epc += 4; // Skip ordinary program breaks
}
}
// Save original instruction
mgmt_bp_ss[0].pAddr = pAddr_next;
mgmt_bp_ss[0].instr = *(mgmt_bp_ss[0].pAddr);
// Replace instruction with managment breakpoint
*(mgmt_bp_ss[0].pAddr) = BP_MGMT_SS(1);
ICACHE_invalidate_at(mgmt_bp_ss[0].pAddr);
mgmt_bp_ss[1].pAddr = NULL;
mgmt_bp_ss[1].pAddr = 0;
// We have two possible management breaks, if previous instruction was branch or jump
if (is_branch_shadow)
{
result = tdisasm(g_buf, (long)pAddr_prev, *pAddr_prev, 0, &junk, &branch_addr, &reg);
// Is jump target stored in register
if (result == 3)
{
branch_addr = xcp->regs[reg&0x1F];
}
// Save original instruction
mgmt_bp_ss[1].pAddr = (UINT32*)branch_addr;
mgmt_bp_ss[1].instr = *(mgmt_bp_ss[1].pAddr);
// Replace instruction with managment breakpoint
*(mgmt_bp_ss[1].pAddr) = BP_MGMT_SS(2);
ICACHE_invalidate_at(mgmt_bp_ss[1].pAddr);
}
break;
case 'P':
g_is_ss = 1;
leave_isr = 1;
// Don't overwrite RU breaks
if (is_user_bp)
break;
// Don't overwrite user breaks
if (IsBreak(*pAddr_curr) && (BreakGetType(*pAddr_curr) == BP_USER_BASE))
break;
// Save original instruction
mgmt_bp_ss[0].pAddr = (UINT32*)xcp->regs[0x1F];
mgmt_bp_ss[0].instr = *(mgmt_bp_ss[0].pAddr);
// Replace instruction with managment breakpoint
*(mgmt_bp_ss[0].pAddr) = BP_MGMT_SS(1);
ICACHE_invalidate_at(mgmt_bp_ss[0].pAddr);
mgmt_bp_ss[1].pAddr = NULL;
mgmt_bp_ss[1].pAddr = 0;
break;
default:
break;
}
} while (!leave_isr);
}
void debug_int(struct xcptcontext * xcp)
{
dbg_handler(xcp);
}
int debug_break(struct xcptcontext * xcp)
{
dbg_handler(xcp);
return 0;
}
void dbg_init(void)
{
memset(&xcp_last, 0, sizeof(EXCEPTION_CONTEXT));
interrupt_register(2, debug_int);
interrupt_enable(2);
xcpt_register(Bp, debug_break);
}
+15
View File
@@ -0,0 +1,15 @@
// MIPS delay.
void __inline__ delay(int loops)
{
__asm
(
".set noreorder\n"
"1:bnez %[loops], 1b\n"
"addiu %[loops], -1\n"
".set reorder\n"
:
: [loops] "r" (loops)
);
}
+67
View File
@@ -0,0 +1,67 @@
/*
* Byte-oriented AES-256 implementation.
* All lookup tables replaced with 'on the fly' calculations.
*
* Copyright (c) 2007 Ilya O. Levin, http://www.literatecode.com
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
#include <stdlib.h>
#include <stdio.h>
#include <time.h>
#include <sys/times.h>
#include <sys/time.h>
#include "aes256.h"
#define DUMP(s, i, buf, sz) {printf(s); \
for (i = 0; i < (sz);i++) \
printf("%02x ", buf[i]); \
printf("\n");}
int main (int argc, char *argv[])
{
aes256_context ctx;
uint8_t key[32];
uint8_t buf[16], i;
long start, end, j;
/* put a test vector */
for (i = 0; i < sizeof(buf);i++) buf[i] = i * 16 + i;
for (i = 0; i < sizeof(key);i++) key[i] = i;
DUMP("txt: ", i, buf, sizeof(buf));
DUMP("key: ", i, key, sizeof(key));
printf("---\n");
aes256_init(&ctx, key);
start = clock();
for (j=0; j < 1000; j++)
{
aes256_encrypt_ecb(&ctx, buf);
}
end = clock();
printf("Speed %f blocks/s\n", (float)j/((float)(end-start)/CLOCKS_PER_SEC));
DUMP("enc: ", i, buf, sizeof(buf));
printf("tst: 8e a2 b7 ca 51 67 45 bf ea fc 49 90 4b 49 60 89\n");
aes256_init(&ctx, key);
aes256_decrypt_ecb(&ctx, buf);
DUMP("dec: ", i, buf, sizeof(buf));
aes256_done(&ctx);
return 0;
} /* main */
+430
View File
@@ -0,0 +1,430 @@
/*
****************************************************************************
*
* "DHRYSTONE" Benchmark Program
* -----------------------------
*
* Version: C, Version 2.1
*
* File: dhry.h (part 1 of 3)
*
* Date: May 25, 1988
*
* Author: Reinhold P. Weicker
* Siemens AG, E STE 35
* Postfach 3240
* 8520 Erlangen
* Germany (West)
* Phone: [xxx-49]-9131-7-20330
* (8-17 Central European Time)
* Usenet: ..!mcvax!unido!estevax!weicker
*
* Original Version (in Ada) published in
* "Communications of the ACM" vol. 27., no. 10 (Oct. 1984),
* pp. 1013 - 1030, together with the statistics
* on which the distribution of statements etc. is based.
*
* In this C version, the following C library functions are used:
* - strcpy, strcmp (inside the measurement loop)
* - printf, scanf (outside the measurement loop)
* In addition, Berkeley UNIX system calls "times ()" or "time ()"
* are used for execution time measurement. For measurements
* on other systems, these calls have to be changed.
*
* Collection of Results:
* Reinhold Weicker (address see above) and
*
* Rick Richardson
* PC Research. Inc.
* 94 Apple Orchard Drive
* Tinton Falls, NJ 07724
* Phone: (201) 389-8963 (9-17 EST)
* Usenet: ...!uunet!pcrat!rick
*
* Please send results to Rick Richardson and/or Reinhold Weicker.
* Complete information should be given on hardware and software used.
* Hardware information includes: Machine type, CPU, type and size
* of caches; for microprocessors: clock frequency, memory speed
* (number of wait states).
* Software information includes: Compiler (and runtime library)
* manufacturer and version, compilation switches, OS version.
* The Operating System version may give an indication about the
* compiler; Dhrystone itself performs no OS calls in the measurement loop.
*
* The complete output generated by the program should be mailed
* such that at least some checks for correctness can be made.
*
***************************************************************************
*
* History: This version C/2.1 has been made for two reasons:
*
* 1) There is an obvious need for a common C version of
* Dhrystone, since C is at present the most popular system
* programming language for the class of processors
* (microcomputers, minicomputers) where Dhrystone is used most.
* There should be, as far as possible, only one C version of
* Dhrystone such that results can be compared without
* restrictions. In the past, the C versions distributed
* by Rick Richardson (Version 1.1) and by Reinhold Weicker
* had small (though not significant) differences.
*
* 2) As far as it is possible without changes to the Dhrystone
* statistics, optimizing compilers should be prevented from
* removing significant statements.
*
* This C version has been developed in cooperation with
* Rick Richardson (Tinton Falls, NJ), it incorporates many
* ideas from the "Version 1.1" distributed previously by
* him over the UNIX network Usenet.
* I also thank Chaim Benedelac (National Semiconductor),
* David Ditzel (SUN), Earl Killian and John Mashey (MIPS),
* Alan Smith and Rafael Saavedra-Barrera (UC at Berkeley)
* for their help with comments on earlier versions of the
* benchmark.
*
* Changes: In the initialization part, this version follows mostly
* Rick Richardson's version distributed via Usenet, not the
* version distributed earlier via floppy disk by Reinhold Weicker.
* As a concession to older compilers, names have been made
* unique within the first 8 characters.
* Inside the measurement loop, this version follows the
* version previously distributed by Reinhold Weicker.
*
* At several places in the benchmark, code has been added,
* but within the measurement loop only in branches that
* are not executed. The intention is that optimizing compilers
* should be prevented from moving code out of the measurement
* loop, or from removing code altogether. Since the statements
* that are executed within the measurement loop have NOT been
* changed, the numbers defining the "Dhrystone distribution"
* (distribution of statements, operand types and locality)
* still hold. Except for sophisticated optimizing compilers,
* execution times for this version should be the same as
* for previous versions.
*
* Since it has proven difficult to subtract the time for the
* measurement loop overhead in a correct way, the loop check
* has been made a part of the benchmark. This does have
* an impact - though a very minor one - on the distribution
* statistics which have been updated for this version.
*
* All changes within the measurement loop are described
* and discussed in the companion paper "Rationale for
* Dhrystone version 2".
*
* Because of the self-imposed limitation that the order and
* distribution of the executed statements should not be
* changed, there are still cases where optimizing compilers
* may not generate code for some statements. To a certain
* degree, this is unavoidable for small synthetic benchmarks.
* Users of the benchmark are advised to check code listings
* whether code is generated for all statements of Dhrystone.
*
* Version 2.1 is identical to version 2.0 distributed via
* the UNIX network Usenet in March 1988 except that it corrects
* some minor deficiencies that were found by users of version 2.0.
* The only change within the measurement loop is that a
* non-executed "else" part was added to the "if" statement in
* Func_3, and a non-executed "else" part removed from Proc_3.
*
***************************************************************************
*
* Defines: The following "Defines" are possible:
* -DREG=register (default: Not defined)
* As an approximation to what an average C programmer
* might do, the "register" storage class is applied
* (if enabled by -DREG=register)
* - for local variables, if they are used (dynamically)
* five or more times
* - for parameters if they are used (dynamically)
* six or more times
* Note that an optimal "register" strategy is
* compiler-dependent, and that "register" declarations
* do not necessarily lead to faster execution.
* -DNOSTRUCTASSIGN (default: Not defined)
* Define if the C compiler does not support
* assignment of structures.
* -DNOENUMS (default: Not defined)
* Define if the C compiler does not support
* enumeration types.
* -DTIMES (default)
* -DTIME
* The "times" function of UNIX (returning process times)
* or the "time" function (returning wallclock time)
* is used for measurement.
* For single user machines, "time ()" is adequate. For
* multi-user machines where you cannot get single-user
* access, use the "times ()" function. If you have
* neither, use a stopwatch in the dead of night.
* "printf"s are provided marking the points "Start Timer"
* and "Stop Timer". DO NOT use the UNIX "time(1)"
* command, as this will measure the total time to
* run this program, which will (erroneously) include
* the time to allocate storage (malloc) and to perform
* the initialization.
* -DHZ=nnn
* In Berkeley UNIX, the function "times" returns process
* time in 1/HZ seconds, with HZ = 60 for most systems.
* CHECK YOUR SYSTEM DESCRIPTION BEFORE YOU JUST APPLY
* A VALUE.
*
***************************************************************************
*
* Compilation model and measurement (IMPORTANT):
*
* This C version of Dhrystone consists of three files:
* - dhry.h (this file, containing global definitions and comments)
* - dhry_1.c (containing the code corresponding to Ada package Pack_1)
* - dhry_2.c (containing the code corresponding to Ada package Pack_2)
*
* The following "ground rules" apply for measurements:
* - Separate compilation
* - No procedure merging
* - Otherwise, compiler optimizations are allowed but should be indicated
* - Default results are those without register declarations
* See the companion paper "Rationale for Dhrystone Version 2" for a more
* detailed discussion of these ground rules.
*
* For 16-Bit processors (e.g. 80186, 80286), times for all compilation
* models ("small", "medium", "large" etc.) should be given if possible,
* together with a definition of these models for the compiler system used.
*
**************************************************************************
*
* Dhrystone (C version) statistics:
*
* [Comment from the first distribution, updated for version 2.
* Note that because of language differences, the numbers are slightly
* different from the Ada version.]
*
* The following program contains statements of a high level programming
* language (here: C) in a distribution considered representative:
*
* assignments 52 (51.0 %)
* control statements 33 (32.4 %)
* procedure, function calls 17 (16.7 %)
*
* 103 statements are dynamically executed. The program is balanced with
* respect to the three aspects:
*
* - statement type
* - operand type
* - operand locality
* operand global, local, parameter, or constant.
*
* The combination of these three aspects is balanced only approximately.
*
* 1. Statement Type:
* ----------------- number
*
* V1 = V2 9
* (incl. V1 = F(..)
* V = Constant 12
* Assignment, 7
* with array element
* Assignment, 6
* with record component
* --
* 34 34
*
* X = Y +|-|"&&"|"|" Z 5
* X = Y +|-|"==" Constant 6
* X = X +|- 1 3
* X = Y *|/ Z 2
* X = Expression, 1
* two operators
* X = Expression, 1
* three operators
* --
* 18 18
*
* if .... 14
* with "else" 7
* without "else" 7
* executed 3
* not executed 4
* for ... 7 | counted every time
* while ... 4 | the loop condition
* do ... while 1 | is evaluated
* switch ... 1
* break 1
* declaration with 1
* initialization
* --
* 34 34
*
* P (...) procedure call 11
* user procedure 10
* library procedure 1
* X = F (...)
* function call 6
* user function 5
* library function 1
* --
* 17 17
* ---
* 103
*
* The average number of parameters in procedure or function calls
* is 1.82 (not counting the function values aX *
*
* 2. Operators
* ------------
* number approximate
* percentage
*
* Arithmetic 32 50.8
*
* + 21 33.3
* - 7 11.1
* * 3 4.8
* / (int div) 1 1.6
*
* Comparison 27 42.8
*
* == 9 14.3
* /= 4 6.3
* > 1 1.6
* < 3 4.8
* >= 1 1.6
* <= 9 14.3
*
* Logic 4 6.3
*
* && (AND-THEN) 1 1.6
* | (OR) 1 1.6
* ! (NOT) 2 3.2
*
* -- -----
* 63 100.1
*
*
* 3. Operand Type (counted once per operand reference):
* ---------------
* number approximate
* percentage
*
* Integer 175 72.3 %
* Character 45 18.6 %
* Pointer 12 5.0 %
* String30 6 2.5 %
* Array 2 0.8 %
* Record 2 0.8 %
* --- -------
* 242 100.0 %
*
* When there is an access path leading to the final operand (e.g. a record
* component), only the final data type on the access path is counted.
*
*
* 4. Operand Locality:
* -------------------
* number approximate
* percentage
*
* local variable 114 47.1 %
* global variable 22 9.1 %
* parameter 45 18.6 %
* value 23 9.5 %
* reference 22 9.1 %
* function result 6 2.5 %
* constant 55 22.7 %
* --- -------
* 242 100.0 %
*
*
* The program does not compute anything meaningful, but it is syntactically
* and semantically correct. All variables have a value assigned to them
* before they are used as a source operand.
*
* There has been no explicit effort to account for the effects of a
* cache, or to balance the use of long or short displacements for code or
* data.
*
***************************************************************************
*/
/* Compiler and system dependent definitions: */
#ifndef TIME
#undef TIMES
#define TIMES
#endif
/* Use times(2) time function unless */
/* explicitly defined otherwise */
#ifdef MSC_CLOCK
#undef HZ
#undef TIMES
#include <time.h>
#define HZ CLK_TCK
#endif
/* Use Microsoft C hi-res clock */
#ifdef TIMES
#include <sys/types.h>
#include <sys/times.h>
/* for "times" */
#endif
#define Mic_secs_Per_Second 1000000.0
/* Berkeley UNIX C returns process times in seconds/HZ */
#ifdef NOSTRUCTASSIGN
#define structassign(d, s) memcpy(&(d), &(s), sizeof(d))
#else
#define structassign(d, s) d = s
#endif
#ifdef NOENUM
#define Ident_1 0
#define Ident_2 1
#define Ident_3 2
#define Ident_4 3
#define Ident_5 4
typedef int Enumeration;
#else
typedef enum {Ident_1, Ident_2, Ident_3, Ident_4, Ident_5}
Enumeration;
#endif
/* for boolean and enumeration types in Ada, Pascal */
/* General definitions: */
#include <stdio.h>
/* for strcpy, strcmp */
#define Null 0
/* Value of a Null pointer */
#define true 1
#define false 0
typedef int One_Thirty;
typedef int One_Fifty;
typedef char Capital_Letter;
typedef int Boolean;
typedef char Str_30 [31];
typedef int Arr_1_Dim [50];
typedef int Arr_2_Dim [50] [50];
typedef struct record
{
struct record *Ptr_Comp;
Enumeration Discr;
union {
struct {
Enumeration Enum_Comp;
int Int_Comp;
char Str_Comp [31];
} var_1;
struct {
Enumeration E_Comp_2;
char Str_2_Comp [31];
} var_2;
struct {
char Ch_1_Comp;
char Ch_2_Comp;
} var_3;
} variant;
} Rec_Type, *Rec_Pointer;
+402
View File
@@ -0,0 +1,402 @@
/*
****************************************************************************
*
* "DHRYSTONE" Benchmark Program
* -----------------------------
*
* Version: C, Version 2.1
*
* File: dhry_1.c (part 2 of 3)
*
* Date: May 25, 1988
*
* Author: Reinhold P. Weicker
*
****************************************************************************
*/
#include "dhry.h"
/* Global Variables: */
Rec_Pointer Ptr_Glob,
Next_Ptr_Glob;
int Int_Glob;
Boolean Bool_Glob;
char Ch_1_Glob,
Ch_2_Glob;
int Arr_1_Glob [50];
int Arr_2_Glob [50] [50];
extern char *malloc ();
Enumeration Func_1 ();
/* forward declaration necessary since Enumeration may not simply be int */
#ifndef REG
Boolean Reg = false;
#define REG
/* REG becomes defined as empty */
/* i.e. no register variables */
#else
Boolean Reg = true;
#endif
/* variables for time measurement: */
#ifdef TIMES
struct tms time_info;
/* see library function "times" */
#define Too_Small_Time (2*HZ)
/* Measurements should last at least about 2 seconds */
#endif
#ifdef TIME
extern long time();
/* see library function "time" */
#define Too_Small_Time 2
/* Measurements should last at least 2 seconds */
#endif
#ifdef MSC_CLOCK
extern clock_t clock();
#define Too_Small_Time (2*HZ)
#endif
long Begin_Time,
End_Time,
User_Time;
float Microseconds,
Dhrystones_Per_Second;
/* end of variables for time measurement */
main ()
/*****/
/* main program, corresponds to procedures */
/* Main and Proc_0 in the Ada version */
{
One_Fifty Int_1_Loc;
REG One_Fifty Int_2_Loc;
One_Fifty Int_3_Loc;
REG char Ch_Index;
Enumeration Enum_Loc;
Str_30 Str_1_Loc;
Str_30 Str_2_Loc;
REG int Run_Index;
REG int Number_Of_Runs;
/* Initializations */
Next_Ptr_Glob = (Rec_Pointer) malloc (sizeof (Rec_Type));
Ptr_Glob = (Rec_Pointer) malloc (sizeof (Rec_Type));
Ptr_Glob->Ptr_Comp = Next_Ptr_Glob;
Ptr_Glob->Discr = Ident_1;
Ptr_Glob->variant.var_1.Enum_Comp = Ident_3;
Ptr_Glob->variant.var_1.Int_Comp = 40;
strcpy (Ptr_Glob->variant.var_1.Str_Comp,
"DHRYSTONE PROGRAM, SOME STRING");
strcpy (Str_1_Loc, "DHRYSTONE PROGRAM, 1'ST STRING");
Arr_2_Glob [8][7] = 10;
/* Was missing in published program. Without this statement, */
/* Arr_2_Glob [8][7] would have an undefined value. */
/* Warning: With 16-Bit processors and Number_Of_Runs > 32000, */
/* overflow may occur for this array element. */
/*
printf ("\n");
printf ("Dhrystone Benchmark, Version 2.1 (Language: C)\n");
printf ("\n");
if (Reg)
{
printf ("Program compiled with 'register' attribute\n");
printf ("\n");
}
else
{
printf ("Program compiled without 'register' attribute\n");
printf ("\n");
}
printf ("Please give the number of runs through the benchmark: ");
{
int n;
scanf ("%d", &n);
Number_Of_Runs = n;
}
printf ("\n");
*/
#ifdef NRUNS
Number_Of_Runs = NRUNS;
#else
Number_Of_Runs = 2000000;
#endif
printf ("Execution starts, %d runs through Dhrystone\n", Number_Of_Runs);
/***************/
/* Start timer */
/***************/
#ifdef TIMES
times (&time_info);
Begin_Time = (long) time_info.tms_utime;
#endif
#ifdef TIME
Begin_Time = time ( (long *) 0);
#endif
#ifdef MSC_CLOCK
Begin_Time = clock();
#endif
for (Run_Index = 1; Run_Index <= Number_Of_Runs; ++Run_Index)
{
Proc_5();
Proc_4();
/* Ch_1_Glob == 'A', Ch_2_Glob == 'B', Bool_Glob == true */
Int_1_Loc = 2;
Int_2_Loc = 3;
strcpy (Str_2_Loc, "DHRYSTONE PROGRAM, 2'ND STRING");
Enum_Loc = Ident_2;
Bool_Glob = ! Func_2 (Str_1_Loc, Str_2_Loc);
/* Bool_Glob == 1 */
while (Int_1_Loc < Int_2_Loc) /* loop body executed once */
{
Int_3_Loc = 5 * Int_1_Loc - Int_2_Loc;
/* Int_3_Loc == 7 */
Proc_7 (Int_1_Loc, Int_2_Loc, &Int_3_Loc);
/* Int_3_Loc == 7 */
Int_1_Loc += 1;
} /* while */
/* Int_1_Loc == 3, Int_2_Loc == 3, Int_3_Loc == 7 */
Proc_8 (Arr_1_Glob, Arr_2_Glob, Int_1_Loc, Int_3_Loc);
/* Int_Glob == 5 */
Proc_1 (Ptr_Glob);
for (Ch_Index = 'A'; Ch_Index <= Ch_2_Glob; ++Ch_Index)
/* loop body executed twice */
{
if (Enum_Loc == Func_1 (Ch_Index, 'C'))
/* then, not executed */
{
Proc_6 (Ident_1, &Enum_Loc);
strcpy (Str_2_Loc, "DHRYSTONE PROGRAM, 3'RD STRING");
Int_2_Loc = Run_Index;
Int_Glob = Run_Index;
}
}
/* Int_1_Loc == 3, Int_2_Loc == 3, Int_3_Loc == 7 */
Int_2_Loc = Int_2_Loc * Int_1_Loc;
Int_1_Loc = Int_2_Loc / Int_3_Loc;
Int_2_Loc = 7 * (Int_2_Loc - Int_3_Loc) - Int_1_Loc;
/* Int_1_Loc == 1, Int_2_Loc == 13, Int_3_Loc == 7 */
Proc_2 (&Int_1_Loc);
/* Int_1_Loc == 5 */
} /* loop "for Run_Index" */
/**************/
/* Stop timer */
/**************/
#ifdef TIMES
times (&time_info);
End_Time = (long) time_info.tms_utime;
#endif
#ifdef TIME
End_Time = time ( (long *) 0);
#endif
#ifdef MSC_CLOCK
End_Time = clock();
#endif
/*
printf ("Execution ends\n");
printf ("\n");
printf ("Final values of the variables used in the benchmark:\n");
printf ("\n");
printf ("Int_Glob: %d\n", Int_Glob);
printf (" should be: %d\n", 5);
printf ("Bool_Glob: %d\n", Bool_Glob);
printf (" should be: %d\n", 1);
printf ("Ch_1_Glob: %c\n", Ch_1_Glob);
printf (" should be: %c\n", 'A');
printf ("Ch_2_Glob: %c\n", Ch_2_Glob);
printf (" should be: %c\n", 'B');
printf ("Arr_1_Glob[8]: %d\n", Arr_1_Glob[8]);
printf (" should be: %d\n", 7);
printf ("Arr_2_Glob[8][7]: %d\n", Arr_2_Glob[8][7]);
printf (" should be: Number_Of_Runs + 10\n");
printf ("Ptr_Glob->\n");
printf (" Ptr_Comp: %d\n", (int) Ptr_Glob->Ptr_Comp);
printf (" should be: (implementation-dependent)\n");
printf (" Discr: %d\n", Ptr_Glob->Discr);
printf (" should be: %d\n", 0);
printf (" Enum_Comp: %d\n", Ptr_Glob->variant.var_1.Enum_Comp);
printf (" should be: %d\n", 2);
printf (" Int_Comp: %d\n", Ptr_Glob->variant.var_1.Int_Comp);
printf (" should be: %d\n", 17);
printf (" Str_Comp: %s\n", Ptr_Glob->variant.var_1.Str_Comp);
printf (" should be: DHRYSTONE PROGRAM, SOME STRING\n");
printf ("Next_Ptr_Glob->\n");
printf (" Ptr_Comp: %d\n", (int) Next_Ptr_Glob->Ptr_Comp);
printf (" should be: (implementation-dependent), same as above\n");
printf (" Discr: %d\n", Next_Ptr_Glob->Discr);
printf (" should be: %d\n", 0);
printf (" Enum_Comp: %d\n", Next_Ptr_Glob->variant.var_1.Enum_Comp);
printf (" should be: %d\n", 1);
printf (" Int_Comp: %d\n", Next_Ptr_Glob->variant.var_1.Int_Comp);
printf (" should be: %d\n", 18);
printf (" Str_Comp: %s\n",
Next_Ptr_Glob->variant.var_1.Str_Comp);
printf (" should be: DHRYSTONE PROGRAM, SOME STRING\n");
printf ("Int_1_Loc: %d\n", Int_1_Loc);
printf (" should be: %d\n", 5);
printf ("Int_2_Loc: %d\n", Int_2_Loc);
printf (" should be: %d\n", 13);
printf ("Int_3_Loc: %d\n", Int_3_Loc);
printf (" should be: %d\n", 7);
printf ("Enum_Loc: %d\n", Enum_Loc);
printf (" should be: %d\n", 1);
printf ("Str_1_Loc: %s\n", Str_1_Loc);
printf (" should be: DHRYSTONE PROGRAM, 1'ST STRING\n");
printf ("Str_2_Loc: %s\n", Str_2_Loc);
printf (" should be: DHRYSTONE PROGRAM, 2'ND STRING\n");
printf ("\n");
*/
User_Time = End_Time - Begin_Time;
if (User_Time < Too_Small_Time)
{
printf ("Measured time too small to obtain meaningful results\n");
printf ("Please increase number of runs\n");
printf ("\n");
}
else
{
#ifdef TIME
Microseconds = (float) User_Time * Mic_secs_Per_Second
/ (float) Number_Of_Runs;
Dhrystones_Per_Second = (float) Number_Of_Runs / (float) User_Time;
#else
Microseconds = (float) User_Time * Mic_secs_Per_Second
/ ((float) HZ * ((float) Number_Of_Runs));
Dhrystones_Per_Second = ((float) HZ * (float) Number_Of_Runs)
/ (float) User_Time;
#endif
printf ("Microseconds for one run through Dhrystone: ");
printf ("%6.1f \n", Microseconds);
printf ("Dhrystones per Second: ");
printf ("%6.1f \n", Dhrystones_Per_Second);
printf ("\n");
printf ("This equals to %6.1f DMIPS\n", Dhrystones_Per_Second/1757);
}
}
Proc_1 (Ptr_Val_Par)
/******************/
REG Rec_Pointer Ptr_Val_Par;
/* executed once */
{
REG Rec_Pointer Next_Record = Ptr_Val_Par->Ptr_Comp;
/* == Ptr_Glob_Next */
/* Local variable, initialized with Ptr_Val_Par->Ptr_Comp, */
/* corresponds to "rename" in Ada, "with" in Pascal */
structassign (*Ptr_Val_Par->Ptr_Comp, *Ptr_Glob);
Ptr_Val_Par->variant.var_1.Int_Comp = 5;
Next_Record->variant.var_1.Int_Comp
= Ptr_Val_Par->variant.var_1.Int_Comp;
Next_Record->Ptr_Comp = Ptr_Val_Par->Ptr_Comp;
Proc_3 (&Next_Record->Ptr_Comp);
/* Ptr_Val_Par->Ptr_Comp->Ptr_Comp
== Ptr_Glob->Ptr_Comp */
if (Next_Record->Discr == Ident_1)
/* then, executed */
{
Next_Record->variant.var_1.Int_Comp = 6;
Proc_6 (Ptr_Val_Par->variant.var_1.Enum_Comp,
&Next_Record->variant.var_1.Enum_Comp);
Next_Record->Ptr_Comp = Ptr_Glob->Ptr_Comp;
Proc_7 (Next_Record->variant.var_1.Int_Comp, 10,
&Next_Record->variant.var_1.Int_Comp);
}
else /* not executed */
structassign (*Ptr_Val_Par, *Ptr_Val_Par->Ptr_Comp);
} /* Proc_1 */
Proc_2 (Int_Par_Ref)
/******************/
/* executed once */
/* *Int_Par_Ref == 1, becomes 4 */
One_Fifty *Int_Par_Ref;
{
One_Fifty Int_Loc;
Enumeration Enum_Loc;
Int_Loc = *Int_Par_Ref + 10;
do /* executed once */
if (Ch_1_Glob == 'A')
/* then, executed */
{
Int_Loc -= 1;
*Int_Par_Ref = Int_Loc - Int_Glob;
Enum_Loc = Ident_1;
} /* if */
while (Enum_Loc != Ident_1); /* true */
} /* Proc_2 */
Proc_3 (Ptr_Ref_Par)
/******************/
/* executed once */
/* Ptr_Ref_Par becomes Ptr_Glob */
Rec_Pointer *Ptr_Ref_Par;
{
if (Ptr_Glob != Null)
/* then, executed */
*Ptr_Ref_Par = Ptr_Glob->Ptr_Comp;
Proc_7 (10, Int_Glob, &Ptr_Glob->variant.var_1.Int_Comp);
} /* Proc_3 */
Proc_4 () /* without parameters */
/*******/
/* executed once */
{
Boolean Bool_Loc;
Bool_Loc = Ch_1_Glob == 'A';
Bool_Glob = Bool_Loc | Bool_Glob;
Ch_2_Glob = 'B';
} /* Proc_4 */
Proc_5 () /* without parameters */
/*******/
/* executed once */
{
Ch_1_Glob = 'A';
Bool_Glob = false;
} /* Proc_5 */
/* Procedure for the assignment of structures, */
/* if the C compiler doesn't support this feature */
#ifdef NOSTRUCTASSIGN
memcpy (d, s, l)
register char *d;
register char *s;
register int l;
{
while (l--) *d++ = *s++;
}
#endif
+192
View File
@@ -0,0 +1,192 @@
/*
****************************************************************************
*
* "DHRYSTONE" Benchmark Program
* -----------------------------
*
* Version: C, Version 2.1
*
* File: dhry_2.c (part 3 of 3)
*
* Date: May 25, 1988
*
* Author: Reinhold P. Weicker
*
****************************************************************************
*/
#include "dhry.h"
#ifndef REG
#define REG
/* REG becomes defined as empty */
/* i.e. no register variables */
#endif
extern int Int_Glob;
extern char Ch_1_Glob;
Proc_6 (Enum_Val_Par, Enum_Ref_Par)
/*********************************/
/* executed once */
/* Enum_Val_Par == Ident_3, Enum_Ref_Par becomes Ident_2 */
Enumeration Enum_Val_Par;
Enumeration *Enum_Ref_Par;
{
*Enum_Ref_Par = Enum_Val_Par;
if (! Func_3 (Enum_Val_Par))
/* then, not executed */
*Enum_Ref_Par = Ident_4;
switch (Enum_Val_Par)
{
case Ident_1:
*Enum_Ref_Par = Ident_1;
break;
case Ident_2:
if (Int_Glob > 100)
/* then */
*Enum_Ref_Par = Ident_1;
else *Enum_Ref_Par = Ident_4;
break;
case Ident_3: /* executed */
*Enum_Ref_Par = Ident_2;
break;
case Ident_4: break;
case Ident_5:
*Enum_Ref_Par = Ident_3;
break;
} /* switch */
} /* Proc_6 */
Proc_7 (Int_1_Par_Val, Int_2_Par_Val, Int_Par_Ref)
/**********************************************/
/* executed three times */
/* first call: Int_1_Par_Val == 2, Int_2_Par_Val == 3, */
/* Int_Par_Ref becomes 7 */
/* second call: Int_1_Par_Val == 10, Int_2_Par_Val == 5, */
/* Int_Par_Ref becomes 17 */
/* third call: Int_1_Par_Val == 6, Int_2_Par_Val == 10, */
/* Int_Par_Ref becomes 18 */
One_Fifty Int_1_Par_Val;
One_Fifty Int_2_Par_Val;
One_Fifty *Int_Par_Ref;
{
One_Fifty Int_Loc;
Int_Loc = Int_1_Par_Val + 2;
*Int_Par_Ref = Int_2_Par_Val + Int_Loc;
} /* Proc_7 */
Proc_8 (Arr_1_Par_Ref, Arr_2_Par_Ref, Int_1_Par_Val, Int_2_Par_Val)
/*********************************************************************/
/* executed once */
/* Int_Par_Val_1 == 3 */
/* Int_Par_Val_2 == 7 */
Arr_1_Dim Arr_1_Par_Ref;
Arr_2_Dim Arr_2_Par_Ref;
int Int_1_Par_Val;
int Int_2_Par_Val;
{
REG One_Fifty Int_Index;
REG One_Fifty Int_Loc;
Int_Loc = Int_1_Par_Val + 5;
Arr_1_Par_Ref [Int_Loc] = Int_2_Par_Val;
Arr_1_Par_Ref [Int_Loc+1] = Arr_1_Par_Ref [Int_Loc];
Arr_1_Par_Ref [Int_Loc+30] = Int_Loc;
for (Int_Index = Int_Loc; Int_Index <= Int_Loc+1; ++Int_Index)
Arr_2_Par_Ref [Int_Loc] [Int_Index] = Int_Loc;
Arr_2_Par_Ref [Int_Loc] [Int_Loc-1] += 1;
Arr_2_Par_Ref [Int_Loc+20] [Int_Loc] = Arr_1_Par_Ref [Int_Loc];
Int_Glob = 5;
} /* Proc_8 */
Enumeration Func_1 (Ch_1_Par_Val, Ch_2_Par_Val)
/*************************************************/
/* executed three times */
/* first call: Ch_1_Par_Val == 'H', Ch_2_Par_Val == 'R' */
/* second call: Ch_1_Par_Val == 'A', Ch_2_Par_Val == 'C' */
/* third call: Ch_1_Par_Val == 'B', Ch_2_Par_Val == 'C' */
Capital_Letter Ch_1_Par_Val;
Capital_Letter Ch_2_Par_Val;
{
Capital_Letter Ch_1_Loc;
Capital_Letter Ch_2_Loc;
Ch_1_Loc = Ch_1_Par_Val;
Ch_2_Loc = Ch_1_Loc;
if (Ch_2_Loc != Ch_2_Par_Val)
/* then, executed */
return (Ident_1);
else /* not executed */
{
Ch_1_Glob = Ch_1_Loc;
return (Ident_2);
}
} /* Func_1 */
Boolean Func_2 (Str_1_Par_Ref, Str_2_Par_Ref)
/*************************************************/
/* executed once */
/* Str_1_Par_Ref == "DHRYSTONE PROGRAM, 1'ST STRING" */
/* Str_2_Par_Ref == "DHRYSTONE PROGRAM, 2'ND STRING" */
Str_30 Str_1_Par_Ref;
Str_30 Str_2_Par_Ref;
{
REG One_Thirty Int_Loc;
Capital_Letter Ch_Loc;
Int_Loc = 2;
while (Int_Loc <= 2) /* loop body executed once */
if (Func_1 (Str_1_Par_Ref[Int_Loc],
Str_2_Par_Ref[Int_Loc+1]) == Ident_1)
/* then, executed */
{
Ch_Loc = 'A';
Int_Loc += 1;
} /* if, while */
if (Ch_Loc >= 'W' && Ch_Loc < 'Z')
/* then, not executed */
Int_Loc = 7;
if (Ch_Loc == 'R')
/* then, not executed */
return (true);
else /* executed */
{
if (strcmp (Str_1_Par_Ref, Str_2_Par_Ref) > 0)
/* then, not executed */
{
Int_Loc += 7;
Int_Glob = Int_Loc;
return (true);
}
else /* executed */
return (false);
} /* if Ch_Loc */
} /* Func_2 */
Boolean Func_3 (Enum_Par_Val)
/***************************/
/* executed once */
/* Enum_Par_Val == Ident_3 */
Enumeration Enum_Par_Val;
{
Enumeration Enum_Loc;
Enum_Loc = Enum_Par_Val;
if (Enum_Loc == Ident_3)
/* then, executed */
return (true);
else /* not executed */
return (false);
} /* Func_3 */
+261
View File
@@ -0,0 +1,261 @@
/* dttl.c -- simulation of Cassini/Huygens symbol synchronizer loop
*
* Author: Lorenzo Simone's (matlab script)
* Modifications by: Jon Hamkins (conversion to C, support routines,
* memory requirement reductions)
* Last Revised: Wed Jan 31 10:47:52 PST 2001
*/
#define M_PI 3.1415926535897932384626433832795
#include <math.h>
#include <stdio.h>
#include "random.h"
/* global variables */
int delay,
L; /* samples per symbol */
double Pt, /* transition density */
sigma; /* noise standard deviation */
long seed=-123;
/* This function simulates a large 1-dimensional array without requiring
* storage for the whole array. This is possible because the array is
* accessed in roughly increasing indices. Thus, we only need to
* store a few symbols worth of samples in the array, and we can reuse
* the array indices as time goes on. */
int drint(double v)
{
return (int)(v+0.5);
}
double
rec(int idx)
{
static int firsttime = 1,
max, /* maximum index containing data */
mod, /* length of ring buffer */
b; /* value of last transmitted bit */
static double r[2000]; /* need several symbols worth of samples */
int i,j,k;
/* First time, store samples for random delay and first few symbols */
if (firsttime==1) {
firsttime=0;
for (i=0; i<delay; i++) r[i] = 0; /* random delay */
b = (ran1(&seed)>0.5) ? 1 : -1; /* first random symbol */
for (j=0; j<3; j++) { /* 3 binary symbols with transition Pt */
b = (ran1(&seed)>Pt) ? b : -b; /* next symbol value */
for (k=0; k<L; k++) r[i++] = b + sigma*gaussian(&seed);
}
max = i-1;
mod = i;
}
if (idx>max) /* check if we need to create another sample */
{
b = (ran1(&seed)>Pt) ? b : -b; /* next symbol value */
/* generate samples for one symbol and store in ring buffer */
for (i=1; i<=L; i++) r[(int)(fmod(max+i,mod))] = b+sigma*gaussian(&seed);
max += L; /* maximum index for which samples exist */
}
/* return appropriate sample from ring buffer */
return(r[(int)(fmod(idx,mod))]);
}
main()
{
double
detout, /* detector output */
I, old_I, /* in-phase accumulations */
Q, old_Q, /* quadrature accumulations */
T, /* transition detection */
theta, /* baseband NCO output (radians) */
lambda, /* normalized timing error (symbols) */
A, alfa, Ampl, Bl, Df,
DR, Es_No, Es_No_lin, Fc1, Fc2, Fvco, Fs, Kd, Kv,
lambda_ss_sim = 0., lambda_ss_th, No, P, P_No,
sigma_lambda_sim = 0., sigma_lambda_th, SNR_sim, SNR_th, tau, Tc1, Tc2,
time, Ts, x1, Y, bit_I, bit_Q, bit;
int i, j, k, N, offset, k1, k2, EOB;
FILE *p1, *p2, *p3, *p4, *p5;
/* Data settings */
Fc1 = 48000; /* sample rate at DTTL input (F1/2 = 8.215MHz/2) */
Tc1 = 1./Fc1;
DR = 4800; /* data rate (symb/sec) */
Fc2 = DR; /* sampling rate pre-detection */
Tc2 = 1./Fc2;
L = drint(Tc2/Tc1); /* samples per symbol in the arm filters */
offset = drint(L/2.);
Es_No = 600.; /* dB */
P_No = Es_No+10.*log10(DR); /* data power-over-noise spectral density */
/* ratio (dBHz) */
N = 2500; /* number of symbols to simulate */
Pt=.5; /* Transition density */
Bl=0.01*DR; /* loop bandwidth (Hz) */
Df=0.001*DR; /* frequency offset */
Fvco=DR+Df;
tau=ran1(&seed)-.5; /* set symbol timing offset, -.5 to .5 */
delay=drint(2.*L+tau*L+1); /* channel delay */
P=1.; /* data power */
Ampl=sqrt(P);
No=10.*log10(P*Tc2)-Es_No; /* noise spectral density (dBW/Hz) */
sigma=sqrt(pow(10.,0.1*No)/(2.*Tc1));
printf("sigma=%f\n",sigma);
/* DPLL settings */
Fs=DR; /* loop sampling frequency (Hz) */
Ts=1./Fs; /* loop sampling time (s) */
/* Loop gain */
Kd=2.*Ampl*Pt; /* phase detector gain (quants/rad) */
/* @ high Es/No */
Kv=1.; /* VCO gain (rad/quants) */
/* Analog loop filter components */
alfa=4.*Bl/(Kd*Kv);
/* Digital loop filter components */
A=alfa*Ts;
/* Initial condition */
theta = 0;
old_I=1;
old_Q=1;
x1=0;
Y=0;
/* Plot data files */
// p1 = fopen("plot1.dat","w"); /* theta */
// p2 = fopen("plot2.dat","w"); /* lambda */
// p3 = fopen("plot3.dat","w"); /* detout */
// p4 = fopen("plot4.dat","w"); /* I-Data */
// p5 = fopen("plot5.dat","w"); /* Q-Data */
k1 = drint(0.5*N);
k2 = N;
printf("Data rate: %.0f symbols/sec\n",DR);
printf("Sample rate at DTTL input: %.0f samples/sec\n",Fc1);
printf("Samples per symbol: %d\n",L);
printf("Random delay set to: %f symbols (%d samples)\n",tau,delay);
printf("Transition density used in random bit generation: %f\n",Pt);
printf("Es/No: %f dB\n",Es_No);
printf("Loop bandwidth: %f Hz\n",Bl);
printf("Doppler: %f Hz\n",Df);
printf("Simulation length: %d symbols (%d samples)\n\n",N,N*L+delay);
/* Simulation Loop */
for (i=2; i<=N; i++)
{
/* loop over symbols */
/* find start of in-phase integration */
for (j=1; j < L; j++)
{
if (fmod(theta + 2*M_PI * Fvco*(j+1+(i-1)*(Fc1/DR))/Fc1, 2*M_PI)
< fmod(theta + 2*M_PI * Fvco*(j +(i-1)*(Fc1/DR))/Fc1, 2*M_PI))
break;
/* one could replace loop above with a direct calculation such as: */
/* j=ceil((1.-modulo(theta/(2*M_PI),1.))/(Fvco*Tc1))-1.; */
/* j+1 is the first index in the block */
EOB=j+(i-1)*L; /* End of Block */
}
/* In-phase integrator */
bit_I = 0.;
printf("Symbol # %d\n", i);
printf("I[%d:%d] :\n", EOB-L+1, EOB);
for (j=EOB-L+1; j<=EOB; j++)
{
bit = rec(j);
if (bit > 0)
printf("-");
else
printf("_");
bit_I += bit;
}
printf("\n");
I = bit_I;
/* Mid-Phase integrator */
bit_Q = 0.;
printf("Q[%d:%d] :\n", EOB-L+offset+1, EOB+offset);
for (j=EOB-L+offset+1; j<=EOB+offset; j++)
{
bit = rec(j);
if (bit > 0)
printf("-");
else
printf("_");
bit_Q += bit;
}
printf("\n\n");
Q = bit_Q;
Q *= 2.*M_PI/(Tc2/Tc1);
/* Transition Detector */
I = (I > 0) ? 1. : -1.; /* hard limiter */
T = 0.5*(I - old_I);
/* Detector Output */
detout = fmod(old_Q*T,2*M_PI);
/* Save accumulations for next time through loop */
old_I = I;
old_Q = Q;
if (fabs(detout)>M_PI)
detout = -detout+2*M_PI*((detout>0) ? 1. : -1.);
/* NCO */
Y += detout*A; /* Loop filter */
theta=Kv*Y; /* phase */
// lambda = theta/(2.*M_PI)+(i*Tc2*Df+tau); /* normalized error */
lambda = theta/(2.*M_PI)+(i*(Fvco/DR -1) + tau); /* normalized error */
/* error mean and variance calculation */
lambda_ss_sim += lambda; /* partial sum */
sigma_lambda_sim += lambda*lambda; /* partial sum of squares */
/* store phase and normalized error to data files */
// fprintf(p1,"%f %f\n",(double)i,theta);
// fprintf(p2,"%f %f\n",(double)i,lambda);
// fprintf(p3,"%f %f\n",(double)i,detout);
// fprintf(p4,"%f %f\n",(double)i,I);
// fprintf(p5,"%f %f\n",(double)i,Q);
}
// fclose(p1);
// fclose(p2);
// fclose(p3);
// fclose(p4);
// fclose(p5);
/* Statistics Analysis */
/* ------------------- */
/* complete the mean and variance calculation */
lambda_ss_sim /= N;
sigma_lambda_sim = sigma_lambda_sim/N - lambda_ss_sim*lambda_ss_sim;
Es_No_lin = pow(10.,0.1*Es_No);
// sigma_lambda_th = Bl*Tc2/(4.*Pt*Es_No_lin*pow(erf(sqrt(Es_No_lin)),2.));
sigma_lambda_th = Bl*Tc2/(4.*Pt*Es_No_lin*Es_No_lin);
SNR_sim = -10*log10(sigma_lambda_sim);
SNR_th = -10*log10(sigma_lambda_th);
/* Steady-State error */
lambda_ss_th=Df/(4.*Bl);
printf("Simulation: var: %f rad^2 loop SNR: %f dB ss error: %f%%\n",
sigma_lambda_sim, SNR_sim, 100.*lambda_ss_sim);
printf("Theory: var: %f rad^2 loop SNR: %f dB ss error: %f%%\n",
sigma_lambda_th, SNR_th, 100.*lambda_ss_th);
// system("gnuplot < plot1.gp");
// system("gnuplot < plot2.gp");
printf("Done.\n");
}
+198
View File
@@ -0,0 +1,198 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <ctype.h>
#include <time.h>
#define CPU_FREQ_HZ 100000000
#include "libsys.h"
#include "crc32.h"
#include "inflate.h"
char buffer[1024*1024];
char * volatile pPtr_r;
char * volatile pPtr_w;
volatile int timeout_cnt;
volatile int file_len;
void handler3(void)
{
volatile UINT32 *pUART_stat = (UINT32*)SYS_UART0_STAT;
volatile UINT32 *pUART_data = (UINT32*)SYS_UART0_DATA;
while(0x200 & *pUART_stat)
{
// sputs("w: "); print_word((int)pPtr_w); sputs("\n");
if (pPtr_w == &buffer[sizeof(buffer)-1])
pPtr_w = buffer;
*(pPtr_w++) = *pUART_data;
timeout_cnt = 100;
file_len++;
}
}
int READBYTE(z_stream *zs) {
if (zs->avail_in <= 0)
return -1;
zs->avail_in --;
return *(zs->next_in ++);
}
#define MAX_BUFOUT 16*1024*1024
int main(int argc, char **argv)
{
volatile UINT32 *pUART_stat = (UINT32*)SYS_UART0_STAT;
unsigned char outData[MAX_BUFOUT];
FILE *infp;
int i, gpflags, tmp[4];
unsigned long size, crc;
unsigned char *fileData;
unsigned long bytes, InflatedSize, InflatedCRC, speed_count;
z_stream zs;
time_t start_time, work_time;
UART0_setbaud(460800);
printf("Reading gzipped stream..\n");
pPtr_r = buffer;
pPtr_w = buffer;
*pUART_stat = (1 << 6);
interrupt_register(3, handler3);
interrupt_enable(3);
file_len = 0;
timeout_cnt = 1000000;
while(timeout_cnt--)
{
sleep(1);
}
printf("file_len: %d\n", file_len);
bytes = file_len;
fileData = pPtr_r;
zs.next_in = fileData;
zs.avail_in = (unsigned int) bytes;
zs.next_out = outData;
zs.avail_out = MAX_BUFOUT;
tmp[0] = READBYTE(&zs);
if (tmp[0] == -1)
{
// error reading from file
printf("error reading data from file\n");
return 0;
}
tmp[1] = READBYTE(&zs);
if (tmp[0] != 0x1f || tmp[1] != 0x8b) {
// fprintf(stderr, "Magic number mismatch 0x%02x%02x\n",
// tmp[0], tmp[1]);
return 20;
}
tmp[0] = READBYTE(&zs);
if(tmp[0] != 8) {
// fprintf(stderr, "Unknown compression method: 0x%02x\n", tmp[0]);
return 20;
}
gpflags = READBYTE(&zs);
if ((gpflags & ~0x1f)) {
printf("Unknown flags set!\n");
}
/* Skip file modification time (4 bytes) */
READBYTE(&zs);
READBYTE(&zs);
READBYTE(&zs);
READBYTE(&zs);
/* Skip extra flags and operating system fields (2 bytes) */
READBYTE(&zs);
READBYTE(&zs);
if ((gpflags & 4)) {
/* Skip extra field */
tmp[0] = READBYTE(&zs);
tmp[1] = READBYTE(&zs);
i = tmp[0] + 256*tmp[1];
while (i--)
{
READBYTE(&zs);
}
}
if((gpflags & 8)) {
while((READBYTE(&zs))) {
}
}
if((gpflags & 16)) {
while((READBYTE(&zs))) {
}
}
if((gpflags & 2)) {
/* Skip CRC16 */
READBYTE(&zs);
READBYTE(&zs);
}
printf("Go\n");
// normal test
start_time = clock();
if (InflateData(&zs))
{
printf("Problem during decompression!\n");
return 0;
}
work_time = clock() - start_time;
/*
// speed test
fprintf(stdout, "SPEED TEST!\n");
speed_count = 0;
while (time(NULL) - start_time < 20)
{
zs_speed.next_in = zs.next_in;
zs_speed.next_out = zs.next_out;
zs_speed.avail_in = zs.avail_in;
zs_speed.avail_out = zs.avail_out;
if (InflateData(&zs_speed))
{
fprintf(stdout, "Problem during decompression!\n");
return 0;
}
speed_count ++;
}
fprintf(stdout, "speed count %ld\n", speed_count);
zs.next_in = zs_speed.next_in;
zs.next_out = zs_speed.next_out;
zs.avail_in = zs_speed.avail_in;
zs.avail_out = zs_speed.avail_out;
*/
crc = READBYTE(&zs);
crc |= (READBYTE(&zs)<<8);
crc |= (READBYTE(&zs)<<16);
crc |= (READBYTE(&zs)<<24);
size = READBYTE(&zs);
size |= (READBYTE(&zs)<<8);
size |= (READBYTE(&zs)<<16);
size |= (READBYTE(&zs)<<24);
InflatedSize = MAX_BUFOUT - zs.avail_out;
InflatedCRC = MakeCRC32(outData, InflatedSize, 0);
// write(1, outData, InflatedSize);
fprintf(stdout, "CRC: %08lx %08lx %s\n", crc, InflatedCRC, (crc != InflatedCRC)?"**error**":"");
fprintf(stdout, "Size: %08lx %08lx %s\n", size, InflatedSize, (size != InflatedSize)?"**error**":"");
fprintf(stdout, "Time for decompression was %.2f seconds\n", (float)work_time/1000);
fprintf(stdout, "Throughput is %d kByte/s\n", InflatedSize/work_time);
return 0;
}
+323
View File
@@ -0,0 +1,323 @@
/********************************************************************\
*
* FILE: hashtest.c
*
* CONTENTS: test file for sample C-implementation of
* RIPEMD-160 and RIPEMD128
* * command line arguments:
* filename -- compute hash code of file read binary
* -sstring -- print string & hashcode
* -t -- perform time trial
* -x -- execute standard test suite, ASCII input
* * for linkage with rmd128.c: define RMDsize as 128
* for linkage with rmd160.c: define RMDsize as 160 (default)
* TARGET: any computer with an ANSI C compiler
*
* AUTHOR: Antoon Bosselaers, ESAT-COSIC
* DATE: 18 April 1996
* VERSION: 1.1
* HISTORY: bug in RMDonemillion() corrected
*
* Copyright (c) Katholieke Universiteit Leuven
* 1996, All Rights Reserved
*
* Conditions for use of the RIPEMD-160 Software
*
* The RIPEMD-160 software is freely available for use under the terms and
* conditions described hereunder, which shall be deemed to be accepted by
* any user of the software and applicable on any use of the software:
*
* 1. K.U.Leuven Department of Electrical Engineering-ESAT/COSIC shall for
* all purposes be considered the owner of the RIPEMD-160 software and of
* all copyright, trade secret, patent or other intellectual property
* rights therein.
* 2. The RIPEMD-160 software is provided on an "as is" basis without
* warranty of any sort, express or implied. K.U.Leuven makes no
* representation that the use of the software will not infringe any
* patent or proprietary right of third parties. User will indemnify
* K.U.Leuven and hold K.U.Leuven harmless from any claims or liabilities
* which may arise as a result of its use of the software. In no
* circumstances K.U.Leuven R&D will be held liable for any deficiency,
* fault or other mishappening with regard to the use or performance of
* the software.
* 3. User agrees to give due credit to K.U.Leuven in scientific publications
* or communications in relation with the use of the RIPEMD-160 software
* as follows: RIPEMD-160 software written by Antoon Bosselaers,
* available at http://www.esat.kuleuven.be/~cosicart/ps/AB-9601/.
*
\********************************************************************/
#ifndef RMDsize
#define RMDsize 160
#endif
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <string.h>
#if RMDsize == 128
#include "rmd128.h"
#elif RMDsize == 160
#include "rmd160.h"
#endif
#define TEST_BLOCK_SIZE 8000
#define TEST_BLOCKS 1250
#define TEST_BYTES ((long)TEST_BLOCK_SIZE * (long)TEST_BLOCKS)
/********************************************************************/
byte *RMD(byte *message)
/*
* returns RMD(message)
* message should be a string terminated by '\0'
*/
{
dword MDbuf[RMDsize/32]; /* contains (A, B, C, D(, E)) */
static byte hashcode[RMDsize/8]; /* for final hash-value */
dword X[16]; /* current 16-word chunk */
unsigned int i; /* counter */
dword length; /* length in bytes of message */
dword nbytes; /* # of bytes not yet processed */
/* initialize */
MDinit(MDbuf);
length = (dword)strlen((char *)message);
/* process message in 16-word chunks */
for (nbytes=length; nbytes > 63; nbytes-=64) {
for (i=0; i<16; i++) {
X[i] = BYTES_TO_DWORD(message);
message += 4;
}
compress(MDbuf, X);
} /* length mod 64 bytes left */
/* finish: */
MDfinish(MDbuf, message, length, 0);
for (i=0; i<RMDsize/8; i+=4) {
hashcode[i] = MDbuf[i>>2]; /* implicit cast to byte */
hashcode[i+1] = (MDbuf[i>>2] >> 8); /* extracts the 8 least */
hashcode[i+2] = (MDbuf[i>>2] >> 16); /* significant bits. */
hashcode[i+3] = (MDbuf[i>>2] >> 24);
}
return (byte *)hashcode;
}
/********************************************************************/
byte *RMDbinary(char *fname)
/*
* returns RMD(message in file fname)
* fname is read as binary data.
*/
{
FILE *mf; /* pointer to file <fname> */
byte data[1024]; /* contains current mess. block */
dword nbytes; /* length of this block */
dword MDbuf[RMDsize/32]; /* contains (A, B, C, D(, E)) */
static byte hashcode[RMDsize/8]; /* for final hash-value */
dword X[16]; /* current 16-word chunk */
unsigned int i, j; /* counters */
dword length[2]; /* length in bytes of message */
dword offset; /* # of unprocessed bytes at */
/* call of MDfinish */
/* initialize */
if ((mf = fopen(fname, "rb")) == NULL) {
fprintf(stderr, "\nRMDbinary: cannot open file \"%s\".\n",
fname);
exit(1);
}
MDinit(MDbuf);
length[0] = 0;
length[1] = 0;
while ((nbytes = fread(data, 1, 1024, mf)) != 0) {
/* process all complete blocks */
for (i=0; i<(nbytes>>6); i++) {
for (j=0; j<16; j++)
X[j] = BYTES_TO_DWORD(data+64*i+4*j);
compress(MDbuf, X);
}
/* update length[] */
if (length[0] + nbytes < length[0])
length[1]++; /* overflow to msb of length */
length[0] += nbytes;
}
/* finish: */
offset = length[0] & 0x3C0; /* extract bytes 6 to 10 inclusive */
MDfinish(MDbuf, data+offset, length[0], length[1]);
for (i=0; i<RMDsize/8; i+=4) {
hashcode[i] = MDbuf[i>>2];
hashcode[i+1] = (MDbuf[i>>2] >> 8);
hashcode[i+2] = (MDbuf[i>>2] >> 16);
hashcode[i+3] = (MDbuf[i>>2] >> 24);
}
fclose(mf);
return (byte *)hashcode;
}
/********************************************************************/
void speedtest(void)
/*
* A time trial routine, to measure the speed of ripemd.
* Measures processor time required to process TEST_BLOCKS times
* a message of TEST_BLOCK_SIZE characters.
*/
{
clock_t t0, t1;
byte *data;
byte hashcode[RMDsize/8];
dword X[16];
dword MDbuf[RMDsize/32];
unsigned int i, j, k;
srand(time(NULL));
/* allocate and initialize test data */
if ((data = (byte*)malloc(TEST_BLOCK_SIZE)) == NULL) {
fprintf(stderr, "speedtest: allocation error\n");
exit(1);
}
for (i=0; i<TEST_BLOCK_SIZE; i++)
data[i] = (byte)(rand() >> 7);
/* start timer */
printf("\n\nRIPEMD-%u time trial. Processing %ld characters...\n",
RMDsize, TEST_BYTES);
t0 = clock();
/* process data */
MDinit(MDbuf);
for (i=0; i<TEST_BLOCKS; i++) {
for (j=0; j<TEST_BLOCK_SIZE; j+=64) {
for (k=0; k<16; k++)
X[k] = BYTES_TO_DWORD(data+j+4*k);
compress(MDbuf, X);
}
}
MDfinish(MDbuf, data, TEST_BYTES, 0);
/* stop timer, get time difference */
t1 = clock();
printf("\nTest input processed in %g seconds.\n",
(double)(t1-t0)/(double)CLOCKS_PER_SEC);
printf("Characters processed per second: %g\n",
(double)CLOCKS_PER_SEC*TEST_BYTES/((double)t1-t0));
printf("\n=> %3.2f Mbit/s\n\n", 8*(double)CLOCKS_PER_SEC*TEST_BYTES/((double)t1-t0)/(1024*1024));
for (i=0; i<RMDsize/8; i+=4) {
hashcode[i] = MDbuf[i>>2];
hashcode[i+1] = (MDbuf[i>>2] >> 8);
hashcode[i+2] = (MDbuf[i>>2] >> 16);
hashcode[i+3] = (MDbuf[i>>2] >> 24);
}
printf("\nhashcode: ");
for (i=0; i<RMDsize/8; i++)
printf("%02x", hashcode[i]);
printf("\n");
free(data);
return;
}
/********************************************************************/
void RMDonemillion(void)
/*
* returns RMD() of message consisting of 1 million 'a' characters
*/
{
dword MDbuf[RMDsize/32]; /* contains (A, B, C, D(, E)) */
static byte hashcode[RMDsize/8]; /* for final hash-value */
dword X[16]; /* current 16-word chunk */
unsigned int i; /* counter */
MDinit(MDbuf);
memcpy(X, "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", 32);
memcpy(X+8, X, 32);
for (i=15625; i>0; i--)
compress(MDbuf, X);
MDfinish(MDbuf, NULL, 1000000UL, 0);
for (i=0; i<RMDsize/8; i+=4) {
hashcode[i] = MDbuf[i>>2];
hashcode[i+1] = (MDbuf[i>>2] >> 8);
hashcode[i+2] = (MDbuf[i>>2] >> 16);
hashcode[i+3] = (MDbuf[i>>2] >> 24);
}
printf("\n* message: 1 million times \"a\"\n hashcode: ");
for (i=0; i<RMDsize/8; i++)
printf("%02x", hashcode[i]);
}
/********************************************************************/
void RMDstring(char *message, char *print)
{
unsigned int i;
byte *hashcode;
hashcode = RMD((byte *)message);
printf("\n* message: %s\n hashcode: ", print);
for (i=0; i<RMDsize/8; i++)
printf("%02x", hashcode[i]);
}
/********************************************************************/
void testsuite (void)
/*
* standard test suite
*/
{
printf("\n\nRIPEMD-%u test suite results (ASCII):\n", RMDsize);
RMDstring("", "\"\" (empty string)");
RMDstring("a", "\"a\"");
RMDstring("abc", "\"abc\"");
RMDstring("message digest", "\"message digest\"");
RMDstring("abcdefghijklmnopqrstuvwxyz", "\"abcdefghijklmnopqrstuvwxyz\"");
RMDstring("abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq",
"\"abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq\"");
RMDstring("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",
"\"A...Za...z0...9\"");
RMDstring("1234567890123456789012345678901234567890"
"1234567890123456789012345678901234567890",
"8 times \"1234567890\"");
RMDonemillion();
printf("\n");
return;
}
/********************************************************************/
main (int argc, char *argv[])
/*
* main program. calls one or more of the test routines depending
* on command line arguments. see the header of this file.
*
*/
{
while(1)
{
// testsuite ();
// printf("\n");
speedtest ();
printf("\n");
}
return 0;
}
/********************** end of file hashtest.c **********************/
+19
View File
@@ -0,0 +1,19 @@
#include <stdio.h>
#define A 0.5
#define B 0.55
_Sat long _Fract sat_add3 (_Sat long _Fract a, _Sat long _Fract b)
{
return a + b;
}
long _Fract mul3 (long _Fract a, long _Fract b)
{
return a * b;
}
int main()
{
printf("hello %X + %X = %X\n", (_Sat long _Fract)A, (_Sat long _Fract)B, sat_add3(A, B));
printf("hello %X * %X = %X\n", (_Sat long _Fract)A, (_Sat long _Fract)B, mul3(A, B));
}
+949
View File
@@ -0,0 +1,949 @@
#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
#include <string.h>
#include "libsys.h"
#include "hpi.h"
static volatile UINT32 _g_int_active;
static volatile UINT32 _g_mbx_return;
static volatile UINT32 _g_mbx_in_flag;
// ---------------------------------------------------------
// Globals
// ---------------------------------------------------------
typedef struct _susb_t
{
fp_t fptr_ept[USB_MAX_NUM_EPT];
void *aptr_ept[USB_MAX_NUM_EPT];
fp_t fptr_rst;
void *aptr_rst;
fp_t fptr_sof;
void *aptr_sof;
fp_t fptr_cfg;
void *aptr_cfg;
fp_t fptr_sus;
void *aptr_sus;
fp_t fptr_id;
void *aptr_id;
fp_t fptr_vbus;
void *aptr_vbus;
} usb_t;
static usb_t _g_usb[USB_MAX_NUM_PORTS];
//static usb_irp_t *_g_usb_irp_ptr[USB_MAX_NUM_PORTS][USB_MAX_NUM_EPT];
// ---------------------------------------------------------
// HPI ISR
// ---------------------------------------------------------
void cy67k3_isr(void)
{
INT32 i;
UINT16 sie_msg, hpi_status;
UINT32 port, siemsg_handled, int_handled;
_g_int_active = 1;
// sputs("--------------------------------------------------------\n");
// sputs("USB-Interrupt(4)\n");
// sputs("HPI Status : ");
hpi_status = cy67k3_read_HPI_STATUS();
// print_word(hpi_status);
// sputs("\n");
// sputs("MAILBOX (REG): ");
// cy67k3_write(HPI_ADDRESS, HPI_REG_MAILBOX);
// print_word(cy67k3_read_HPI_DATA());
// sputs("\n");
int_handled = 0;
if (hpi_status & HPI_STATUS_MBX_IN)
{
int_handled = 1;
// sputs("MAILBOX (HPI): ");
_g_mbx_return = cy67k3_read_HPI_MAILBOX();
_g_mbx_in_flag = 1;
// print_word(_g_mbx_return);
// sputs("\n");
}
if (hpi_status & HPI_STATUS_RESET1)
{
int_handled = 1;
hpi_read_reg(SUSB1_REG_STATUS);
hpi_comm_exec_int(SUSB_INIT_INT, 2, R1, 0, R2, 1);
// sputs("RESET 1\n");
}
if (hpi_status & HPI_STATUS_RESET2)
{
int_handled = 1;
hpi_read_reg(SUSB2_REG_STATUS);
hpi_comm_exec_int(SUSB_INIT_INT, 2, R1, 0, R2, 2);
// sputs("RESET 2\n");
}
if (hpi_status & HPI_STATUS_DONE1)
{
int_handled = 1;
// sputs("DONE 1\n");
}
if (hpi_status & HPI_STATUS_DONE2)
{
int_handled = 1;
// sputs("DONE 2\n");
}
if (hpi_status & HPI_STATUS_SOFEOP1)
{
int_handled = 1;
hpi_read_reg(SUSB1_REG_STATUS);
// sputs("SOF/EOP 1\n");
}
if (hpi_status & HPI_STATUS_SOFEOP2)
{
int_handled = 1;
hpi_read_reg(SUSB2_REG_STATUS);
// sputs("SOF/EOP 2\n");
}
port = 0;
siemsg_handled = 0;
if (hpi_status & HPI_STATUS_SIEMSG1)
{
int_handled = 1;
sie_msg = hpi_read_reg(HPI_REG_SIE1MSG);
// Reset message register
hpi_write_reg(HPI_REG_SIE1MSG, 0x0000);
if (sie_msg & SUSB_RST_MSG)
{
siemsg_handled = 1;
if (_g_usb[port].fptr_rst)
(_g_usb[port].fptr_rst)(_g_usb[port].aptr_rst);
}
if (sie_msg & SUSB_SOF_MSG)
{
siemsg_handled = 1;
if (_g_usb[port].fptr_sof)
(_g_usb[port].fptr_sof)(_g_usb[port].aptr_sof);
}
if (sie_msg & SUSB_CFG_MSG)
{
siemsg_handled = 1;
if (_g_usb[port].fptr_cfg)
(_g_usb[port].fptr_cfg)(_g_usb[port].aptr_cfg);
}
if (sie_msg & SUSB_SUS_MSG)
{
siemsg_handled = 1;
if (_g_usb[port].fptr_sus)
(_g_usb[port].fptr_sus)(_g_usb[port].aptr_sus);
}
if (sie_msg & SUSB_ID_MSG)
{
siemsg_handled = 1;
if (_g_usb[port].fptr_id)
(_g_usb[port].fptr_id)(_g_usb[port].aptr_id);
}
if (sie_msg & SUSB_VBUS_MSG)
{
siemsg_handled = 1;
if (_g_usb[port].fptr_vbus)
(_g_usb[port].fptr_vbus)(_g_usb[port].aptr_vbus);
}
for (i=0; i < 8; i++)
{
if (sie_msg & (SUSB_EP0_MSG << i))
{
siemsg_handled = 1;
if (_g_usb[port].fptr_ept[i])
(_g_usb[port].fptr_ept[i])(_g_usb[port].aptr_ept[i]);
}
}
if (!siemsg_handled)
{
sputs("Unhandled SIE1 message ");
print_word(sie_msg);
sputs("!\n");
}
}
port = 1;
siemsg_handled = 0;
if (hpi_status & HPI_STATUS_SIEMSG2)
{
int_handled = 1;
sie_msg = hpi_read_reg(HPI_REG_SIE2MSG);
// Reset message register
hpi_write_reg(HPI_REG_SIE2MSG, 0x0000);
if (sie_msg & SUSB_RST_MSG)
{
siemsg_handled = 1;
if (_g_usb[port].fptr_rst)
(_g_usb[port].fptr_rst)(_g_usb[port].aptr_rst);
}
if (sie_msg & SUSB_SOF_MSG)
{
siemsg_handled = 1;
if (_g_usb[port].fptr_sof)
(_g_usb[port].fptr_sof)(_g_usb[port].aptr_sof);
}
if (sie_msg & SUSB_CFG_MSG)
{
siemsg_handled = 1;
if (_g_usb[port].fptr_cfg)
(_g_usb[port].fptr_cfg)(_g_usb[port].aptr_cfg);
}
if (sie_msg & SUSB_SUS_MSG)
{
siemsg_handled = 1;
if (_g_usb[port].fptr_sus)
(_g_usb[port].fptr_sus)(_g_usb[port].aptr_sus);
}
if (sie_msg & SUSB_ID_MSG)
{
siemsg_handled = 1;
if (_g_usb[port].fptr_id)
(_g_usb[port].fptr_id)(_g_usb[port].aptr_id);
}
if (sie_msg & SUSB_VBUS_MSG)
{
siemsg_handled = 1;
if (_g_usb[port].fptr_vbus)
(_g_usb[port].fptr_vbus)(_g_usb[port].aptr_vbus);
}
for (i=0; i < 8; i++)
{
if (sie_msg & (SUSB_EP0_MSG << i))
{
siemsg_handled = 1;
if (_g_usb[port].fptr_ept[i])
(_g_usb[port].fptr_ept[i])(_g_usb[port].aptr_ept[i]);
}
}
if (!siemsg_handled)
{
sputs("Unhandled SIE2 message ");
print_word(sie_msg);
sputs("!\n");
}
}
if (!int_handled)
{
sputs("Unhandled interrupt (status = ");
print_word(hpi_status);
sputs(")!\n");
}
// sputs("--------------------------------------------------------\n");
_g_int_active = 0;
}
// ---------------------------------------------------------
// CY7C67300 low-level routines
// ---------------------------------------------------------
void cy67k3_reset(void)
{
int i;
volatile UINT32 *pHpi = (UINT32*)SYS_USB_CTRL;
*pHpi = 3;
for (i=0; i <160; i++)
{
__asm __volatile
(
".set noreorder\n"
"nop\n"
"nop\n"
"nop\n"
"nop\n"
".set reorder\n"
);
}
*pHpi = 2;
}
UINT16 cy67k3_read_HPI_DATA(void)
{
volatile UINT32 *pHpi = (UINT32*)SYS_USB_DATA;
return (UINT16)*pHpi;
}
UINT16 cy67k3_read_HPI_MAILBOX(void)
{
volatile UINT32 *pHpi = (UINT32*)SYS_USB_MBX;
return (UINT16)*pHpi;
}
UINT16 cy67k3_read_HPI_ADDRESS(void)
{
volatile UINT32 *pHpi = (UINT32*)SYS_USB_ADDR;
return (UINT16)*pHpi;
}
UINT16 cy67k3_read_HPI_STATUS(void)
{
volatile UINT32 *pHpi = (UINT32*)SYS_USB_STATUS;
return (UINT16)*pHpi;
}
void cy67k3_write_HPI_DATA(UINT16 data)
{
volatile UINT32 *pHpi = (UINT32*)SYS_USB_DATA;
*pHpi = (UINT32)data;
}
void cy67k3_write_HPI_MAILBOX(UINT16 data)
{
volatile UINT32 *pHpi = (UINT32*)SYS_USB_MBX;
*pHpi = (UINT32)data;
}
void cy67k3_write_HPI_ADDRESS(UINT16 data)
{
volatile UINT32 *pHpi = (UINT32*)SYS_USB_ADDR;
*pHpi = (UINT32)data;
}
void cy67k3_write_HPI_STATUS(UINT16 data)
{
volatile UINT32 *pHpi = (UINT32*)SYS_USB_STATUS;
*pHpi = (UINT32)data;
}
// ---------------------------------------------------------
// HPI API
// ---------------------------------------------------------
UINT32 hpi_init(void)
{
volatile UINT32 *pHpi = (UINT32*)SYS_USB_CTRL;
int i;
UINT16 reg;
// ToDo: Enable HPI interrupt
_g_int_active = 0;
hpi_write_reg(HPI_REG_SIE1MSG, 0x0000);
hpi_write_reg(HPI_REG_SIE2MSG, 0x0000);
hpi_write_reg(SUSB1_REG_STATUS, 0xFFFF);
hpi_write_reg(SUSB2_REG_STATUS, 0xFFFF);
// Init 1
for(i=0; i < USB_MAX_NUM_EPT; i++)
{
hpi_write_reg(SUSB1_REG_EP_ADDR0 + 16*i, 0);
hpi_write_reg(SUSB1_REG_EP_CNTRES0 + 16*i, 0);
hpi_write_reg(SUSB1_REG_EP_COUNT0 + 16*i, 0);
hpi_write_reg(SUSB1_REG_EP_CTRL0 + 16*i, 0);
hpi_write_reg(SUSB1_REG_EP_STATUS0 + 16*i, 0);
}
// Init 2
for(i=0; i < USB_MAX_NUM_EPT; i++)
{
hpi_write_reg(SUSB2_REG_EP_ADDR0 + 16*i, 0);
hpi_write_reg(SUSB2_REG_EP_CNTRES0 + 16*i, 0);
hpi_write_reg(SUSB2_REG_EP_COUNT0 + 16*i, 0);
hpi_write_reg(SUSB2_REG_EP_CTRL0 + 16*i, 0);
hpi_write_reg(SUSB2_REG_EP_STATUS0 + 16*i, 0);
}
hpi_write_reg(HPI_REG_INTROUTE, 0x0000);
reg = hpi_read_reg(HPI_REG_INTROUTE);
// hpi_write_reg(HPI_REG_INTROUTE, reg | 0x0202); // Route reset {1,2} to HPI only
// hpi_write_reg(HPI_REG_INTROUTE, reg | 0x2800); // Route SOF/EOP {1,2} to HPI only
// hpi_write_reg(HPI_REG_INTROUTE, reg | 0x1400); // Route SOF/EOP {1,2} to CY16 only
hpi_write_reg(HPI_REG_INTROUTE, reg | 0x3C00); // Route SOF/EOP {1,2} to HPI and CY16
interrupt_register(4, cy67k3_isr);
interrupt_enable(4);
*pHpi = 0x02;
return HPI_NOERROR;
}
void hpi_mbx_write(UINT16 msgcode)
{
_g_mbx_in_flag = 0;
cy67k3_write_HPI_MAILBOX(msgcode);
}
UINT32 hpi_mbx_read(void)
{
UINT32 err;
UINT16 cy_return;
if (_g_int_active)
{
while (!(cy67k3_read_HPI_STATUS() & HPI_STATUS_MBX_IN));
cy_return = cy67k3_read_HPI_MAILBOX();
}
else
{
while(!_g_mbx_in_flag);
cy_return = _g_mbx_return;
}
switch (cy_return)
{
case COMM_ACK:
err = cy_return;
break;
case COMM_NAK:
case COMM_ASYNC:
err = HPI_ERR_PREFIX_MBX | cy_return;
break;
default:
err = HPI_ERR_PREFIX_MBX | cy_return;
break;
}
return err;
}
UINT32 hpi_check_addr(UINT16 addr)
{
if ((addr >= 0x0000) && (addr < 0x4000))
return 0;
if ((addr >= 0xC080) && (addr < 0xC0BC))
return 0;
if (addr >= 0xE000)
return 0;
sputs("Invalid address for HPI direct access! Use LCP-command instead!\n");
return HPI_ERR_INVPARAM;
}
UINT32 hpi_read_reg(UINT16 addr)
{
UINT32 result;
result = hpi_check_addr(addr);
if (IS_ERROR(result))
return result;
cy67k3_write_HPI_ADDRESS(addr);
return cy67k3_read_HPI_DATA();
}
UINT32 hpi_write_reg(UINT16 addr, UINT16 data)
{
UINT32 result;
result = hpi_check_addr(addr);
if (IS_ERROR(result))
return result;
cy67k3_write_HPI_ADDRESS(addr);
cy67k3_write_HPI_DATA(data);
}
UINT32 hpi_write_ram(UINT16 addr, UINT16 *pData, UINT32 len)
{
int i, num_words;
if (addr > 0x3FFE)
return HPI_ERR_INVPARAM;
if (addr & 1) // Not 16bit aligned?
return HPI_ERR_INVPARAM;
cy67k3_write_HPI_ADDRESS(addr);
num_words = len/2;
if (len % 2)
num_words++;
for (i=0; i < num_words; i++)
cy67k3_write_HPI_DATA(pData[i]);
return len;
}
UINT32 hpi_read_ram(UINT16 addr, UINT16 *pData, UINT32 len)
{
int i, num_words;
if (addr > 0x3FFE)
return HPI_ERR_INVPARAM;
if (addr & 1) // Not 16bit aligned?
return HPI_ERR_INVPARAM;
cy67k3_write_HPI_ADDRESS(addr);
num_words = len/2;
if (len % 2)
num_words++;
for (i=0; i < num_words; i++)
pData[i] = cy67k3_read_HPI_DATA();
return len;
}
UINT32 hpi_comm_reset(void)
{
hpi_mbx_write(COMM_RESET);
return hpi_mbx_read();
}
UINT32 hpi_comm_jump2code(UINT16 addr)
{
cy67k3_write_HPI_ADDRESS(addr);
hpi_mbx_write(COMM_JUMP2CODE);
return hpi_mbx_read();
}
UINT32 hpi_comm_callcode(UINT16 addr)
{
hpi_write_reg(COMM_CODE_ADDR, addr);
hpi_mbx_write(COMM_CALL_CODE);
return hpi_mbx_read();
}
UINT32 hpi_comm_write_ctrl_reg(UINT16 addr, UINT16 data, UINT16 logic)
{
hpi_write_reg(COMM_CTRL_REG_ADDR, addr);
hpi_write_reg(COMM_CTRL_REG_DATA, data);
hpi_write_reg(COMM_CTRL_REG_LOGIC, logic);
hpi_mbx_write(COMM_WRITE_CTRL_REG);
return hpi_mbx_read();
}
UINT32 hpi_comm_read_ctrl_reg(UINT16 addr)
{
UINT32 result;
hpi_write_reg(COMM_CTRL_REG_ADDR, addr);
hpi_mbx_write(COMM_READ_CTRL_REG);
result = hpi_mbx_read();
if (IS_ERROR(result))
return result;
cy67k3_write_HPI_ADDRESS(COMM_CTRL_REG_DATA);
return (UINT32)cy67k3_read_HPI_DATA();
}
UINT32 hpi_comm_write_xmem(UINT16 addr, UINT8 *pData, UINT16 len)
{
return HPI_ERR_NOTIMPL;
}
UINT32 hpi_comm_read_xmem(UINT16 addr, UINT8 *pData, UINT16 len)
{
return HPI_ERR_NOTIMPL;
}
typedef struct _sreg_param_t
{
UINT32 id;
UINT16 val;
} reg_param_t;
UINT32 hpi_comm_exec_int(UINT16 intnum, UINT32 nargs, ...)
{
int i;
UINT32 result;
va_list args;
reg_param_t reg_param[MAX_NUM_REGS];
va_start(args, nargs);
if (nargs > MAX_NUM_REGS)
{
fprintf(stderr, "hpi_comm_exec_int(): Number (%d), of arguments exceeds %d!\n", nargs, MAX_NUM_REGS);
return HPI_ERR_INVPARAM;
}
for (i=0; i < nargs; i++)
{
reg_param[i].id = va_arg(args, UINT32);
if (reg_param[i].id > MAX_NUM_REGS)
{
fprintf(stderr, "hpi_comm_exec_int(): Invalid register R%d!\n", reg_param[i].id);
return HPI_ERR_INVPARAM;
}
reg_param[i].val = (UINT16)va_arg(args, UINT32);
}
va_end(args);
hpi_write_reg(COMM_INT_NUM, intnum);
for (i=0; i < nargs; i++)
{
hpi_write_reg(COMM_R0 + 2*reg_param[i].id, reg_param[i].val);
}
hpi_mbx_write(COMM_EXEC_INT);
result = hpi_mbx_read();
if (IS_ERROR(result))
return result;
return (UINT32)hpi_read_reg(COMM_R0);
}
UINT32 usb_init(void)
{
INT32 i;
for (i=0; i < USB_MAX_NUM_PORTS; i++)
{
memset(&_g_usb[i], 0, sizeof(usb_t));
}
return 0;
}
UINT32 usb_callback_register(UINT32 port, UINT32 type, fp_t pFunc, void *pArg)
{
UINT32 result;
if (port >= USB_MAX_NUM_PORTS)
return -1;
result = 0;
switch (type)
{
case SUSB_EP0_MSG:
_g_usb[port].fptr_ept[0] = pFunc;
_g_usb[port].aptr_ept[0] = pArg;
break;
case SUSB_EP1_MSG:
_g_usb[port].fptr_ept[1] = pFunc;
_g_usb[port].aptr_ept[1] = pArg;
break;
case SUSB_EP2_MSG:
_g_usb[port].fptr_ept[2] = pFunc;
_g_usb[port].aptr_ept[2] = pArg;
break;
case SUSB_EP3_MSG:
_g_usb[port].fptr_ept[3] = pFunc;
_g_usb[port].aptr_ept[3] = pArg;
break;
case SUSB_EP4_MSG:
_g_usb[port].fptr_ept[4] = pFunc;
_g_usb[port].aptr_ept[4] = pArg;
break;
case SUSB_EP5_MSG:
_g_usb[port].fptr_ept[5] = pFunc;
_g_usb[port].aptr_ept[5] = pArg;
break;
case SUSB_EP6_MSG:
_g_usb[port].fptr_ept[6] = pFunc;
_g_usb[port].aptr_ept[6] = pArg;
break;
case SUSB_EP7_MSG:
_g_usb[port].fptr_ept[7] = pFunc;
_g_usb[port].aptr_ept[7] = pArg;
break;
case SUSB_RST_MSG:
_g_usb[port].fptr_rst = pFunc;
_g_usb[port].aptr_rst = pArg;
break;
case SUSB_SOF_MSG:
_g_usb[port].fptr_sof = pFunc;
_g_usb[port].aptr_sof = pArg;
break;
case SUSB_CFG_MSG:
_g_usb[port].fptr_cfg = pFunc;
_g_usb[port].aptr_cfg = pArg;
break;
case SUSB_SUS_MSG:
_g_usb[port].fptr_sus = pFunc;
_g_usb[port].aptr_sus = pArg;
break;
case SUSB_ID_MSG:
_g_usb[port].fptr_id = pFunc;
_g_usb[port].aptr_id = pArg;
break;
case SUSB_VBUS_MSG:
_g_usb[port].fptr_vbus = pFunc;
_g_usb[port].aptr_vbus = pArg;
break;
default:
result = -1;
break;
}
return result;
}
UINT32 usb_irp_register(usb_irp_t *pIRP, UINT32 port, UINT32 ept, UINT32 size, UINT32 is_out)
{
if (!pIRP)
return -1;
if (port >= USB_MAX_NUM_PORTS)
return -1;
if (ept >= USB_MAX_NUM_EPT)
return -1;
if (size >= USB_MAX_IMG_SIZE)
return -1;
memset(pIRP, 0, sizeof(usb_irp_t));
pIRP->is_out = is_out;
pIRP->is_in = !is_out;
pIRP->tsize = size;
pIRP->port = port;
pIRP->ept = ept;
pIRP->cy_irp_addr = USB_IRP_BASE + port*USB_MAX_NUM_EPT*sizeof(cy_req_t) + ept*sizeof(cy_req_t);
pIRP->cy_req.next = 0;
pIRP->cy_req.addr = USB_IMG_BASE + port*USB_MAX_NUM_EPT*USB_MAX_IMG_SIZE + ept*USB_MAX_IMG_SIZE;
pIRP->cy_req.size = size;
pIRP->cy_req.callback = 0;
fifo_alloc(&pIRP->fifo, 8*USB_MAX_IMG_SIZE);
return 0;
}
UINT32 usb_irp_enqueue(usb_irp_t *pIRP)
{
UINT32 result;
if (!pIRP)
{
// sputs ("usb_irp_enqueue(): Invalid IRP!\n");
return -1;
}
// printf("cy_addr: %4.4X, Next: %4.4X, Addr: %4.4X, Size: %4.4X, CB: %4.4X\n", pIRP->cy_irp_addr, pIRP->cy_req.next, pIRP->cy_req.addr, pIRP->cy_req.size, pIRP->cy_req.callback);
if (pIRP->is_out)
{
hpi_write_ram(pIRP->cy_irp_addr, (UINT16*)&pIRP->cy_req, sizeof(cy_req_t));
if (pIRP->port == 0)
result = hpi_comm_exec_int(SUSB1_RECEIVE_INT, 2, R1, pIRP->ept, R8, pIRP->cy_irp_addr);
if (pIRP->port == 1)
result = hpi_comm_exec_int(SUSB2_RECEIVE_INT, 2, R1, pIRP->ept, R8, pIRP->cy_irp_addr);
}
if (pIRP->is_in)
{
pIRP->tx_in_progress = 1;
hpi_write_ram(pIRP->cy_irp_addr, (UINT16*)&pIRP->cy_req, sizeof(cy_req_t));
if (pIRP->port == 0)
result = hpi_comm_exec_int(SUSB1_SEND_INT, 2, R1, pIRP->ept, R8, pIRP->cy_irp_addr);
if (pIRP->port == 1)
result = hpi_comm_exec_int(SUSB2_SEND_INT, 2, R1, pIRP->ept, R8, pIRP->cy_irp_addr);
}
// if (result)
// printf ("usb_irp_enqueue(): Result = %8.8X\n", result);
return result;
}
UINT32 fifo_alloc(fifo_t *pObj, UINT32 size)
{
pObj->pBuf = (UINT8*)malloc(size);
if (!pObj->pBuf)
{
// printf ("fifo_alloc(): Error allocating memory!\n");
return -1;
}
// printf ("fifo_alloc(): pBuf at %8.8X\n", (UINT32)pObj->pBuf);
pObj->size = size;
pObj->pPtr_wr = pObj->pBuf;
pObj->pPtr_rd = pObj->pBuf;
return 0;
}
UINT32 fifo_free(fifo_t *pObj)
{
if (pObj->pBuf)
free(pObj->pBuf);
return 0;
}
UINT32 fifo_flush(fifo_t *pObj)
{
pObj->pPtr_wr = pObj->pBuf;
pObj->pPtr_rd = pObj->pBuf;
return 0;
}
UINT32 fifo_is_empty(fifo_t *pObj)
{
return (pObj->pPtr_wr == pObj->pPtr_rd);
}
UINT32 fifo_is_full(fifo_t *pObj)
{
UINT8 *pNext, *pEnd;
pEnd = pObj->pBuf + pObj->size;
pNext = pObj->pPtr_wr + 1;
if (pNext == pEnd)
pNext = pObj->pBuf;
return (pNext == pObj->pPtr_rd);
}
UINT32 fifo_read(fifo_t *pObj, UINT8 *pData, UINT32 size, UINT32 timeout, UINT32 do_block)
{
UINT32 i;
UINT32 wait_4ever, timeout_cnt, cnt;
UINT8 *pEnd;
pEnd = pObj->pBuf + pObj->size;
wait_4ever = (timeout == 0);
cnt = 0;
while(size)
{
timeout_cnt = timeout;
while(fifo_is_empty(pObj))
{
if (!do_block)
return cnt;
if (!wait_4ever)
{
if (timeout_cnt)
{
timeout_cnt--;
sleep(1);
}
else
{
return cnt;
}
}
}
if (pData)
pData[cnt] = *(pObj->pPtr_rd);
cnt++;
pObj->pPtr_rd++;
if (pObj->pPtr_rd == pEnd)
pObj->pPtr_rd = pObj->pBuf;
size--;
}
return cnt;
}
UINT32 fifo_write(fifo_t *pObj, UINT8 *pData, UINT32 size, UINT32 timeout, UINT32 do_block)
{
UINT32 wait_4ever, timeout_cnt, cnt;
UINT8 *pEnd;
pEnd = pObj->pBuf + pObj->size;
wait_4ever = (timeout == 0);
cnt = 0;
while(size)
{
timeout_cnt = timeout;
while(fifo_is_full(pObj))
{
if (!do_block)
return cnt;
if (!wait_4ever)
{
if (timeout_cnt)
{
timeout_cnt--;
sleep(1);
}
else
{
return cnt;
}
}
}
if (pData)
*(pObj->pPtr_wr) = pData[cnt];
cnt++;
pObj->pPtr_wr++;
if (pObj->pPtr_wr == pEnd)
pObj->pPtr_wr = pObj->pBuf;
size--;
}
return cnt;
}
// ---------------------------------------------------------
+384
View File
@@ -0,0 +1,384 @@
#ifndef HPI_H
#define HPI_H
// ---------------------------------------------------------
// API related
// ---------------------------------------------------------
//#define IS_ERROR(e) (0 != (e & HPI_ERROR))
#define HPI_NOERROR 0
#define HPI_ERROR 0x80000000
#define HPI_ERR_NOTIMPL (HPI_ERROR + 1)
#define HPI_ERR_INVPARAM (HPI_ERROR + 2)
#define HPI_ERR_TIMEOUT (HPI_ERROR + 3)
#define HPI_ERR_PREFIX_MBX (HPI_ERROR + 0x00010000)
#define MAX_NUM_REGS 14
#define R0 0
#define R1 1
#define R2 2
#define R3 3
#define R4 4
#define R5 5
#define R6 6
#define R7 7
#define R8 8
#define R9 9
#define R10 10
#define R11 11
#define R12 12
#define R13 13
#define USB_MAX_NUM_PORTS 2
#define USB_MAX_NUM_EPT 8
#define USB_MAX_IMG_SIZE 512
#define USB_IRP_BASE 0x0F80
#define USB_IMG_BASE 0x1000
typedef void (*fp_t)(void*);
// Receive buffer on EP
typedef struct _scy_req_t
{
UINT16 next;
UINT16 addr;
UINT16 size;
UINT16 callback;
} cy_req_t;
typedef struct _sfifo_t
{
UINT32 size;
UINT8 *pBuf;
UINT8 * volatile pPtr_wr, * volatile pPtr_rd;
} fifo_t;
typedef struct _susb_irp_t
{
UINT16 tsize;
UINT32 is_in, is_out;
UINT32 port, ept;
UINT16 cy_irp_addr;
fifo_t fifo;
UINT32 tx_in_progress;
cy_req_t cy_req;
} usb_irp_t;
// ---------------------------------------------------------
// CY7C67300 related
// ---------------------------------------------------------
#define HPI_WAITACK 1
#define HPI_NOWAIT 0
// ---------------------------------------------------------
// HPI status flags
#define HPI_STATUS_MBX_IN 0x0001
#define HPI_STATUS_RESET1 0x0002
#define HPI_STATUS_DONE1 0x0004
#define HPI_STATUS_DONE2 0x0008
#define HPI_STATUS_SIEMSG1 0x0010
#define HPI_STATUS_SIEMSG2 0x0020
#define HPI_STATUS_RESUME1 0x0040
#define HPI_STATUS_RESUME2 0x0080
#define HPI_STATUS_MBX_OUT 0x0100
#define HPI_STATUS_RESET2 0x0200
#define HPI_STATUS_SOFEOP1 0x0400
#define HPI_STATUS_SOFEOP2 0x1000
#define HPI_STATUS_ID 0x4000
#define HPI_STATUS_VBUS 0x8000
// ---------------------------------------------------------
// LCP command codes
#define COMM_RESET 0xFA50
#define COMM_JUMP2CODE 0xCE00
#define COMM_EXEC_INT 0xCE01
#define COMM_READ_CTRL_REG 0xCE02
#define COMM_WRITE_CTRL_REG 0xCE03
#define COMM_CALL_CODE 0xCE04
#define COMM_READ_XMEM 0xCE05
#define COMM_WRITE_XMEM 0xCE06
#define C0MM_CONFIG 0xCE07
#define COMM_READ_MEM 0xCE08
#define COMM_WRITE_MEM 0xCE09
// LCP response codes
#define COMM_ACK 0x0FED
#define COMM_NAK 0xDEAD
#define COMM_ASYNC 0xF00D
// ---------------------------------------------------------
// LCP memory addresses
#define COMM_PORT_CMD 0x01BA // For PORT Command
#define COMM_MEM_ADDR 0x01BC // Address for COMM_RD/WR_MEM
#define COMM_MEM_LEN 0x01BE // Address for COMM_RD/WR_MEM
#define COMM_LAST_DATA 0x01C0 // memory pointer for xmem
#define COMM_CTRL_REG_ADDR 0x01BC // Address for COMM_RD/WR_CTRL_REG
#define COMM_CTRL_REG_DATA 0x01BE // Address for COMM_RD/WR_CTRL_REG
#define COMM_CTRL_REG_LOGIC 0x01C0 // Address used for AND/OR
#define REG_WRITE_FLG 0x0000 // Value for COMM_CTRL_REG_LOGIC
#define REG_AND_FLG 0x0001 // Value for COMM_CTRL_REG_LOGIC
#define REG_OR_FLG 0x0002 // Value for COMM_CTRL_REG_LOGIC
#define COMM_TIMEOUT 0x01BE // Address setting Timeout for sending response to host
#define COMM_CODE_ADDR 0x01BC // Address for COMM_CALL_CODE and COMM_JUMP2CODE
#define COMM_INT_NUM 0x01C2 // Address used for COMM_EXEC_INT
#define COMM_R0 0x01C4 // CY16-R0 register
#define COMM_R1 0x01C6 // CY16-R1 register
#define COMM_R2 0x01C8 // CY16-R2 register
#define COMM_R3 0x01CA // CY16-R3 register
#define COMM_R4 0x01CC // CY16-R4 register
#define COMM_R5 0x01CE // CY16-R5 register
#define COMM_R6 0x01D0 // CY16-R6 register
#define COMM_R7 0x01D2 // CY16-R7 register
#define COMM_R8 0x01D4 // CY16-R8 register
#define COMM_R9 0x01D6 // CY16-R9 register
#define COMM_R10 0x01D8 // CY16-R10 register
#define COMM_R11 0x01DA // CY16-R11 register
#define COMM_R12 0x01DC // CY16-R12 register
#define COMM_R13 0x01DE // CY16-R13 register
// for COMM_CTRL_REG_LOGIC
#define LOGIC_DIRECT 0
#define LOGIC_AND 1
#define LOGIC_OR 2
// ---------------------------------------------------------
// Software interrupts
#define SUSB_INIT_INT 113
// USB 1
#define SUSB1_DEVICE_DESCRIPTOR_VEC 90
#define SUSB1_CONFIGURATION_DESCRIPTOR_VEC 91
#define SUSB1_STRING_DESCRIPTOR_VEC 92
#define SUSB1_FINISH_INT 89
#define SUSB1_STALL_INT 82
#define SUSB1_STANDARD_INT 83
#define SUSB1_SEND_INT 80
#define SUSB1_RECEIVE_INT 81
#define SUSB1_VENDOR_INT 85
#define SUSB1_CLASS_INT 87
#define SUSB1_LOADER_INT 94
#define SUSB1_DELTA_CONFIG_INT 95
// USB 2
#define SUSB2_DEVICE_DESCRIPTOR_VEC 106
#define SUSB2_CONFIGURATION_DESCRIPTOR_VEC 107
#define SUSB2_STRING_DESCRIPTOR_VEC 108
#define SUSB2_FINISH_INT 105
#define SUSB2_STALL_INT 98
#define SUSB2_STANDARD_INT 99
#define SUSB2_SEND_INT 96
#define SUSB2_RECEIVE_INT 97
#define SUSB2_VENDOR_INT 101
#define SUSB2_CLASS_INT 103
#define SUSB2_LOADER_INT 110
#define SUSB2_DELTA_CONFIG_INT 111
// ---------------------------------------------------------
// General USB Registers
#define USB_REG_FLAGS 0xC000 // CPU Flags
#define USB_REG_BANK 0xC002 // Register Bank
#define USB_REG_REVISON 0xC004 // Hardware Revision
#define USB_REG_SPEED 0xC008 // CPU Speed
#define USB_REG_PWRCTRL 0xC00A // Power Control
#define USB_REG_INTEN 0xC00E // Interrupt Enable
#define USB_REG_BP 0xC014 // Breakpoint
#define USB_REG_USBDIAG 0xC03C // USB Diagnostic
#define USB_REG_MEMDIAG 0xC03E // Memory Diagnostic
// HPI registers
#define HPI_REG_BP 0x0140 // HPI Breakpoint
#define HPI_REG_INTROUTE 0x0142 // Interrupt Routing
#define HPI_REG_SIE1MSG 0x0144 // SIE1msg
#define HPI_REG_SIE2MSG 0x0148 // SIE2msg
#define HPI_REG_MAILBOX 0xC0C6 // HPI Mailbox
// ---------------------------------------------------------
// General Device Registers
// Device 1
#define SUSB1_REG_PORTSEL 0xC084 // Port select
#define SUSB1_REG_USBCTRL 0xC08A // USB control
#define SUSB1_REG_INTEN 0xC08C // Interrupt enable
#define SUSB1_REG_ADDR 0xC08E // Address
#define SUSB1_REG_STATUS 0xC090 // Status
#define SUSB1_REG_FRAMENUM 0xC092 // Frame number
#define SUSB1_REG_SOFEOPCNT 0xC094 // SOF/EOP count
// Device 2
#define SUSB2_REG_PORTSEL 0xC0A4 // Port select
#define SUSB2_REG_USBCTRL 0xC0AA // USB control
#define SUSB2_REG_INTEN 0xC0AC // Interrupt enable
#define SUSB2_REG_ADDR 0xC0AE // Address
#define SUSB2_REG_STATUS 0xC0B0 // Status
#define SUSB2_REG_FRAMENUM 0xC0B2 // Frame number
#define SUSB2_REG_SOFEOPCNT 0xC0B4 // SOF/EOP count
// ---------------------------------------------------------
// Endpoint Registers
// Device 1 Control
#define SUSB1_REG_EP_CTRL0 0x0200
#define SUSB1_REG_EP_CTRL1 0x0210
#define SUSB1_REG_EP_CTRL2 0x0220
#define SUSB1_REG_EP_CTRL3 0x0230
#define SUSB1_REG_EP_CTRL4 0x0240
#define SUSB1_REG_EP_CTRL5 0x0250
#define SUSB1_REG_EP_CTRL6 0x0260
#define SUSB1_REG_EP_CTRL7 0x0270
// Device 1 Address
#define SUSB1_REG_EP_ADDR0 0x0202
#define SUSB1_REG_EP_ADDR1 0x0212
#define SUSB1_REG_EP_ADDR2 0x0222
#define SUSB1_REG_EP_ADDR3 0x0232
#define SUSB1_REG_EP_ADDR4 0x0242
#define SUSB1_REG_EP_ADDR5 0x0252
#define SUSB1_REG_EP_ADDR6 0x0262
#define SUSB1_REG_EP_ADDR7 0x0272
// Device 1 Count
#define SUSB1_REG_EP_COUNT0 0x0204
#define SUSB1_REG_EP_COUNT1 0x0214
#define SUSB1_REG_EP_COUNT2 0x0224
#define SUSB1_REG_EP_COUNT3 0x0234
#define SUSB1_REG_EP_COUNT4 0x0244
#define SUSB1_REG_EP_COUNT5 0x0254
#define SUSB1_REG_EP_COUNT6 0x0264
#define SUSB1_REG_EP_COUNT7 0x0274
// Device 1 Status
#define SUSB1_REG_EP_STATUS0 0x0206
#define SUSB1_REG_EP_STATUS1 0x0216
#define SUSB1_REG_EP_STATUS2 0x0226
#define SUSB1_REG_EP_STATUS3 0x0236
#define SUSB1_REG_EP_STATUS4 0x0246
#define SUSB1_REG_EP_STATUS5 0x0256
#define SUSB1_REG_EP_STATUS6 0x0266
#define SUSB1_REG_EP_STATUS7 0x0276
// Device 1 Count result
#define SUSB1_REG_EP_CNTRES0 0x0208
#define SUSB1_REG_EP_CNTRES1 0x0218
#define SUSB1_REG_EP_CNTRES2 0x0228
#define SUSB1_REG_EP_CNTRES3 0x0238
#define SUSB1_REG_EP_CNTRES4 0x0248
#define SUSB1_REG_EP_CNTRES5 0x0258
#define SUSB1_REG_EP_CNTRES6 0x0268
#define SUSB1_REG_EP_CNTRES7 0x0278
// Device 2 Control
#define SUSB2_REG_EP_CTRL0 0x0280
#define SUSB2_REG_EP_CTRL1 0x0290
#define SUSB2_REG_EP_CTRL2 0x02A0
#define SUSB2_REG_EP_CTRL3 0x02B0
#define SUSB2_REG_EP_CTRL4 0x02C0
#define SUSB2_REG_EP_CTRL5 0x02D0
#define SUSB2_REG_EP_CTRL6 0x02E0
#define SUSB2_REG_EP_CTRL7 0x02F0
// Device 2 Address
#define SUSB2_REG_EP_ADDR0 0x0282
#define SUSB2_REG_EP_ADDR1 0x0292
#define SUSB2_REG_EP_ADDR2 0x02A2
#define SUSB2_REG_EP_ADDR3 0x02B2
#define SUSB2_REG_EP_ADDR4 0x02C2
#define SUSB2_REG_EP_ADDR5 0x02D2
#define SUSB2_REG_EP_ADDR6 0x02E2
#define SUSB2_REG_EP_ADDR7 0x02F2
// Device 2 Count
#define SUSB2_REG_EP_COUNT0 0x0284
#define SUSB2_REG_EP_COUNT1 0x0294
#define SUSB2_REG_EP_COUNT2 0x02A4
#define SUSB2_REG_EP_COUNT3 0x02B4
#define SUSB2_REG_EP_COUNT4 0x02C4
#define SUSB2_REG_EP_COUNT5 0x02D4
#define SUSB2_REG_EP_COUNT6 0x02E4
#define SUSB2_REG_EP_COUNT7 0x02F4
// Device 2 Status
#define SUSB2_REG_EP_STATUS0 0x0286
#define SUSB2_REG_EP_STATUS1 0x0296
#define SUSB2_REG_EP_STATUS2 0x02A6
#define SUSB2_REG_EP_STATUS3 0x02B6
#define SUSB2_REG_EP_STATUS4 0x02C6
#define SUSB2_REG_EP_STATUS5 0x02D6
#define SUSB2_REG_EP_STATUS6 0x02E6
#define SUSB2_REG_EP_STATUS7 0x02F6
// Device 2 Count result
#define SUSB2_REG_EP_CNTRES0 0x0288
#define SUSB2_REG_EP_CNTRES1 0x0298
#define SUSB2_REG_EP_CNTRES2 0x02A8
#define SUSB2_REG_EP_CNTRES3 0x02B8
#define SUSB2_REG_EP_CNTRES4 0x02C8
#define SUSB2_REG_EP_CNTRES5 0x02D8
#define SUSB2_REG_EP_CNTRES6 0x02E8
#define SUSB2_REG_EP_CNTRES7 0x02F8
// ---------------------------------------------------------
// others
#define HUSB_TDLISTDONE 0x1000
#define HUSB_SOF 0x2000
#define HUSB_ARMV 0x0001
#define HUSB_AINS_FS 0x0002
#define HUSB_AINS_LS 0x0004
#define HUSB_AWAKEUP 0x0008
#define HUSB_BRMV 0x0010
#define HUSB_BINS_FS 0x0020
#define HUSB_BINS_LS 0x0040
#define HUSB_BWAKEUP 0x0080
#define SUSB_EP0_MSG 0x0001
#define SUSB_EP1_MSG 0x0002
#define SUSB_EP2_MSG 0x0004
#define SUSB_EP3_MSG 0x0008
#define SUSB_EP4_MSG 0x0010
#define SUSB_EP5_MSG 0x0020
#define SUSB_EP6_MSG 0x0040
#define SUSB_EP7_MSG 0x0080
#define SUSB_RST_MSG 0x0100
#define SUSB_SOF_MSG 0x0200
#define SUSB_CFG_MSG 0x0400
#define SUSB_SUS_MSG 0x0800
#define SUSB_ID_MSG 0x4000
#define SUSB_VBUS_MSG 0x8000
// ---------------------------------------------------------
// Functions
// ---------------------------------------------------------
// HPI low-level routines
void cy67k3_isr(void);
void cy67k3_reset(void);
UINT16 cy67k3_read_HPI_DATA(void);
UINT16 cy67k3_read_HPI_MAILBOX(void);
UINT16 cy67k3_read_HPI_ADDRESS(void);
UINT16 cy67k3_read_HPI_STATUS(void);
void cy67k3_write_HPI_DATA(UINT16 data);
void cy67k3_write_HPI_MAILBOX(UINT16 data);
void cy67k3_write_HPI_ADDRESS(UINT16 data);
void cy67k3_write_HPI_STATUS(UINT16 data);
// HPI API
UINT32 hpi_init(void);
void hpi_mbx_write(UINT16 msgcode);
UINT32 hpi_mbx_read(void);
UINT32 hpi_read_reg(UINT16 addr);
UINT32 hpi_write_reg(UINT16 addr, UINT16 data);
UINT32 hpi_write_ram(UINT16 addr, UINT16 *pData, UINT32 num_words);
UINT32 hpi_read_ram(UINT16 addr, UINT16 *pData, UINT32 num_words);
UINT32 hpi_comm_reset(void);
UINT32 hpi_comm_jump2code(UINT16 addr);
UINT32 hpi_comm_callcode(UINT16 addr);
UINT32 hpi_comm_write_ctrl_reg(UINT16 addr, UINT16 data, UINT16 logic);
UINT32 hpi_comm_read_ctrl_reg(UINT16 addr);
UINT32 hpi_comm_write_xmem(UINT16 addr, UINT8 *pData, UINT16 len);
UINT32 hpi_comm_read_xmem(UINT16 addr, UINT8 *pData, UINT16 len);
UINT32 hpi_comm_exec_int(UINT16 intnum, UINT32 nargs, ...);
// USB API
UINT32 usb_init(void);
UINT32 usb_irp_register(usb_irp_t *pIRP, UINT32 port, UINT32 ept, UINT32 size, UINT32 is_out);
UINT32 usb_irp_enqueue(usb_irp_t *pIRP);
UINT32 usb_callback_register(UINT32 port, UINT32 type, fp_t pFunc, void *pArg);
#define FIFO_BLOCK 1
#define FIFO_NONBLOCK 0
UINT32 fifo_alloc(fifo_t *pObj, UINT32 size);
UINT32 fifo_free(fifo_t *pObj);
UINT32 fifo_flush(fifo_t *pObj);
UINT32 fifo_is_full(fifo_t *pObj);
UINT32 fifo_is_empty(fifo_t *pObj);
UINT32 fifo_read(fifo_t *pObj, UINT8 *pData, UINT32 size, UINT32 timeout, UINT32 do_block);
UINT32 fifo_write(fifo_t *pObj, UINT8 *pData, UINT32 size, UINT32 timeout, UINT32 do_block);
#endif // HPI_H
+504
View File
@@ -0,0 +1,504 @@
/* inflate routines for Palm OS (to inflate a deflated stream)
*
* Based heavily upon gunzip.c by Pasi Ojala <albert@cs.tut.fi>
* http://www.cs.tut.fi/~albert/Dev/gunzip/
* Many, many thanks for that code!
*
* Changes:
* 2002-12-30 - Added #defines to use zlib's struct instead of mine, just
* in case you want to compile it that way.
* 2002-12-29 - Found out that this is VERY slow. ZLib is 3x faster.
* Worked on speeding it up. Partially successful. Profiled
* code and marked critical areas. 1932 bytes added to a
* Palm program by linking in the .o file. Schweet!
* 2002-12-21 - Finished surgery. Only one function to inflate dynamic and
* fixed data. Rewrote table generation to be iterative.
* Hacked and slashed my way through unnecessary code.
* The size is now down to 3512 bytes.
* 2002-12-20 - Started major surgery
* 2002-12-19 - Looked at the code a bit more
* 2002-12-17 - Continued work. Down to about 6k for the .o file
* 2002-12-09 - Continued work, added z_stream_fid instead of globals
* 2002-12-08 - Started work so that it decompresses up to 64k (one memory
* chunk on the Palm.
* 2002-12-07 - Removed bit reverse table. Removed unzip code.
*/
#include "libsys.h"
#include "inflate.h"
#ifdef VERBOSE
#include <stdio.h> // Just in case you put a printf() function back in
#endif
void Status(char *, int);
typedef struct HufNode_struct {
// b0 and b1 are either values in the tree array to jump to (branches)
// or are literal values.
// if (bX & 0x8000)
// value = bX ^ 0x8000;
// else
// link_to_array_element = bX;
unsigned int b0; // Bigger than 1 byte (2 is ideal)
unsigned int b1; // Bigger than 1 byte (2 is ideal)
} HufNode;
// Not that rhobust anymore -- If out of data, this will
// return a whole lot of 1 bits.
//
// This function consumes a large percentage of time (#1)
char READBIT(z_stream *zs)
{
char carry;
if (zs->reserved == 1)
{
if (zs->avail_in == 0)
return 1;
zs->reserved = *(zs->next_in ++) | 0x0100;
zs->avail_in --;
}
carry = zs->reserved & 1;
zs->reserved >>= 1;
return carry;
}
// Make sure that [a] is <= 16
// If there are endian problems, force [a] to be <= 8
// Might be faster if all (up to [a] bits) of zs->reserved was read into res
// right away.
//
// This function consumes a large percentage of time (#4)
int READBITS(z_stream *zs, int a)
{
int res = 0, pos = 0;
while (a --)
{
if (zs->reserved == 1)
{
if (zs->avail_in == 0)
return 1;
zs->reserved = *(zs->next_in ++) | 0x0100;
zs->avail_in --;
}
res += (zs->reserved & 1) << pos;
zs->reserved >>= 1;
pos ++;
}
return res;
}
// Huffman tree structures, variables and related routines
//
// These routines are one-bit-at-a-time decode routines. They
// are not as fast as multi-bit routines, but maybe a bit easier
// to understand and use a lot less memory.
//
// The tree is created in an array
//
// currentTree = where to put the tree (in an array)
// numval = Number of elements in the lengths array
// lengths = array of lengths
//
//
// This function consumes a large percentage of time (#5)
int CreateTree(HufNode *currentTree, int numval, unsigned char *lengths) {
int i, j, len; // basically scratch values
int BlankNode; // Where is the next blank array index
int this_code, mask, *bitData; // used in tree generation
int bl_count[16] = { 0, }; // Counter of code lengths
int next_code[16] = { 0, }; // Code for a specific length
// 16 = (15 is max length of a code when inflating) + (1 for zero)
// Step 1: Count the code lengths
for (i = 0; i < numval; i ++)
{
j = lengths[i];
if (j > 15)
return 1;
bl_count[j] ++;
}
// Step 2: Find numerical value of the smallest code of each length
// Also note that I've inserted some weak validation code here. I'm
// not 100% sure that it is up to RFC specs, but it seems to work fine
// in my tests
//
// The validation theory is that at the root node, you have 2 branches or
// values possible. If you branch, you get 2 more potentials. If you
// get a value, you lose one potential. So, if the root node has one of
// each, the number of potentials at the next level is still two. If that
// node just has branches, the number of potentials is four. If both of
// the nodes on the following level just have values, the number of
// potentials is 0, leaving us with a complete tree.
//
// If I don't validate and if an invalid tree gets generated, an
// infinite loop is possible
bl_count[0] = 0;
j = 0;
len = 2;
for (i = 1; i < 16; i ++)
{
len -= bl_count[i];
len *= 2;
j = (j + bl_count[i - 1]) << 1;
next_code[i] = j;
}
if (len)
return 1;
// Step 3: Assign numerical values to all codes
BlankNode = 1;
currentTree[0].b0 = 0x0000;
currentTree[0].b1 = 0x0000;
for (i = 0; i < numval; i ++)
{
len = lengths[i];
if (len != 0)
{
this_code = next_code[len];
next_code[len] ++;
mask = 1 << (len - 1);
j = 0;
while (mask > 1)
{
if (this_code & mask)
bitData = &(currentTree[j].b1);
else
bitData = &(currentTree[j].b0);
if (*bitData == 0x0000)
{
*bitData = BlankNode;
j = BlankNode;
BlankNode ++;
currentTree[j].b0 = 0x0000;
currentTree[j].b1 = 0x0000;
}
else
j = *bitData;
mask >>= 1;
}
if (this_code & 0x01)
currentTree[j].b1 = 0x8000 | i;
else
currentTree[j].b0 = 0x8000 | i;
}
}
#ifdef VERBOSE
fprintf(stderr, "%d table entries used\n",
BlankNode);
if (numval < 20) {
for (i = 0; i < BlankNode; i ++)
{
fprintf(stderr, "0x%03x - ", i);
if (currentTree[i].b0 & 0x8000)
fprintf(stderr, "value: 0x%03x ", currentTree[i].b0 ^ 0x8000);
else
fprintf(stderr, " link: 0x%03x ", currentTree[i].b0);
if (currentTree[i].b1 & 0x8000)
fprintf(stderr, "value: 0x%03x\n", currentTree[i].b1 ^ 0x8000);
else
fprintf(stderr, " link: 0x%03x\n", currentTree[i].b1);
}
}
#endif
return 0;
}
// Using the tree passed in, read bits from the data stream until we arrive
// at the proper value
//
// This function consumes a large percentage of time (#2)
int DecodeValue(z_stream *zs, HufNode *currentTree)
{
unsigned int i = 0;
// decode one symbol of the data per iteration
// Infinite loop detection code could go here. Maximum
// bits to read is 15.
while (i < 0x8000)
{
if (READBIT(zs))
i = currentTree[i].b1;
else
i = currentTree[i].b0;
}
return i & 0x7FFF;
}
int Decompress_Stored(z_stream *zs)
{
int blockLen, cSum;
#ifdef VERBOSE
fprintf(stderr, "Stored\n");
#endif
zs->reserved = 1;;
if (zs->avail_in < 4)
return -1;
zs->avail_in -= 4;
blockLen = *(zs->next_in ++);
blockLen |= *(zs->next_in ++) << 8;
cSum = *(zs->next_in ++);
cSum |= (*(zs->next_in ++) << 8);
if ((blockLen + cSum) ^ 0xFFFF)
return 1;
if (zs->avail_in < blockLen || zs->avail_out < blockLen)
return -1;
zs->avail_in -= blockLen;
zs->avail_out -= blockLen;
while (blockLen --)
{
*(zs->next_out) = *(zs->next_in);
zs->next_out ++;
zs->next_in ++;
}
return 0;
}
int MakeTrees(z_stream *zs, char is_fixed, HufNode *literalTree,
HufNode *distanceTree)
{
// Order of the bit length code lengths
static const unsigned border[] = {
16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15 };
unsigned char ll[288+32];
int i, j, n, l, literalCodes, distCodes;
if (is_fixed)
{
literalCodes = 288;
// Set a large range to 8
for (i = 0; i < 288; i ++)
ll[i] = 8;
// In that range, set some to 9 and others to 7
// (smaller code, but slightly slower table generation)
for (i = 144; i < 256; i ++)
ll[i] = 9;
for (; i < 280; i ++)
ll[i] = 7;
distCodes = 32;
for (i = 288; i < 320; i ++)
ll[i] = 5;
}
else
{
literalCodes = 257 + READBITS(zs, 5);
distCodes = 1 + READBITS(zs, 5);
l = 4 + READBITS(zs, 4);
for (j = 0; j < 19; j ++)
ll[j] = 0;
// Get the decode tree code lengths
// The decode tree is Huffman encoded
for (j = 0; j < l; j++)
{
ll[border[j]] = READBITS(zs, 3);
}
if (CreateTree(distanceTree, 19, ll))
return 1;
// read in literal and distance code lengths
n = literalCodes + distCodes;
i = 0;
while (i < n)
{
j = DecodeValue(zs, distanceTree);
if (j < 16) // length of code in bits (0..15)
ll[i++] = j;
else if (j == 16)
{ // repeat last length 3 to 6 times
j = 3 + READBITS(zs, 2);
if (i + j > n)
return 1;
l = i ? ll[i-1] : 0;
while (j --)
ll[i++] = l;
}
else
{
if (j == 17) // 3 to 10 zero length codes
j = 3 + READBITS(zs, 3);
else // j == 18: 11 to 138 zero length codes
j = 11 + READBITS(zs, 7);
if (i + j > n)
return 1;
while (j --)
ll[i++] = 0;
}
}
}
// Can overwrite tree decode tree as it is not used anymore
if (CreateTree(literalTree, literalCodes, &ll[0]))
return 1;
if(CreateTree(distanceTree, distCodes, &ll[literalCodes]))
return 1;
return 0;
}
// This function consumes a large percentage of time (#3)
// Most output produced by gzip/zlib/etc is dynamic.
int Decompress_DynamicOrFixed(z_stream *zs, char is_fixed)
{
// Copy lengths for literal codes 257..285
static const unsigned short cplens[] = {
3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31,
35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 0, 0 };
// Extra bits for literal codes 257..285
static const unsigned short cplext[] = {
0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2,
3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0, 99, 99 }; // 99==invalid
// Copy offsets for distance codes 0..29
static const unsigned short cpdist[] = {
0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0007, 0x0009, 0x000d,
0x0011, 0x0019, 0x0021, 0x0031, 0x0041, 0x0061, 0x0081, 0x00c1,
0x0101, 0x0181, 0x0201, 0x0301, 0x0401, 0x0601, 0x0801, 0x0c01,
0x1001, 0x1801, 0x2001, 0x3001, 0x4001, 0x6001 };
// Extra bits for distance codes
static const unsigned short cpdext[] = {
0, 0, 0, 0, 1, 1, 2, 2,
3, 3, 4, 4, 5, 5, 6, 6,
7, 7, 8, 8, 9, 9, 10, 10,
11, 11, 12, 12, 13, 13 };
HufNode literalTree[288];
HufNode distanceTree[32];
int j, l, dist;
#ifdef VERBOSE
if (is_fixed)
fprintf(stderr, "Fixed Huffman codes\n");
else
fprintf(stderr, "Dynamic Huffman codes\n");
#endif
if (MakeTrees(zs, is_fixed, literalTree, distanceTree))
return 1;
while (1)
{
j = DecodeValue(zs, literalTree);
if (j >= 256)
{
if (j == 256) // EOF
break;
//printf("%04x ", j);
j -= 256 + 1; // bytes + EOF
l = READBITS(zs, cplext[j]) + cplens[j];
//printf("%04x ", l);
j = DecodeValue(zs, distanceTree);
//printf("%02x ", j);
dist = READBITS(zs, cpdext[j]) + cpdist[j];
//printf("%04x ", dist);
//printf("LZ77 len %d dist %d @%04x\n", l, dist, bIdx);
while(l--)
{
//printf("%02x ", c);
if (! zs->avail_out --)
return -1;
*(zs->next_out ++) = *(zs->next_out - dist);
}
//printf("\n");
}
else
{
//printf("%02x\n", j);
if (! zs->avail_out --)
return -1;
*(zs->next_out ++) = (unsigned char) j;
}
}
return 0;
}
// Returns 0 if success
int InflateData(z_stream *zs) {
int last, type;
zs->reserved = 1;;
do
{
last = READBIT(zs);
#ifdef VERBOSE
if (last)
fprintf(stderr, "Last Block: ");
else
fprintf(stderr, "Not Last Block: ");
#endif
type = READBITS(zs, 2);
if (type == 0)
{
#ifdef VERBOSE
fprintf(stderr, "Decompress_Stored..");
#endif
if (Decompress_Stored(zs))
return 1;
}
else if (type > 2)
{
#ifdef VERBOSE
if (type == 3)
fprintf(stderr, "Reserved block type!!\n");
else // the "else" should never happen
fprintf(stderr, "Unexpected value %d!\n", type);
#endif
zs->reserved = 1;;
return 1;
}
else
{
#ifdef VERBOSE
fprintf(stderr, "Decompress_DynamicOrFixed..");
#endif
if (Decompress_DynamicOrFixed(zs, type & 0x01))
return 1;
}
} while(!last);
zs->reserved = 1;;
return 0;
}
+15
View File
@@ -0,0 +1,15 @@
#ifdef USE_ZLIB_STRUCT
#include "SysZLib.h" // For PalmOS. Change to your liking.
#else
typedef struct z_stream_s
{
unsigned char *next_in; // Next input byte (CHANGES)
unsigned int avail_in; // number of bytes left at next_in
unsigned char *next_out; // Next output byte goes here (CHANGES)
unsigned int avail_out; // number of bytes left at next_out
unsigned int reserved; // For the readbit() and readbits() functions
// Bigger than 1 byte
} z_stream;
#endif
int InflateData(z_stream *zs);
+92
View File
@@ -0,0 +1,92 @@
#include <sys/times.h>
#include <sys/time.h>
#include <sys/stat.h>
#include <errno.h>
#include <stdlib.h>
#include "libsys.h"
#include "regdef.h"
#include "xcpt.h"
#include "irq.h"
static fp_irq_t g_irq_handler[MAX_NUM_IRQ] = {NULL};
int _irq_dispatch(struct xcptcontext * xcp)
{
int i, ip, cause;
cause = xcp->cr & xcp->sr;
ip = (cause >> 8) & 0xFF;
for (i=0; i < MAX_NUM_IRQ; i++)
{
if (ip & 1)
if (g_irq_handler[i])
(g_irq_handler[i])(xcp);
ip >>= 1;
}
return 0;
}
void interrupt_register(int irq_num, fp_irq_t fp)
{
if ((irq_num >= 0) && (irq_num < MAX_NUM_IRQ))
g_irq_handler[irq_num] = fp;
}
void interrupt_enable(int irq_num)
{
reg_t reg, im;
if ((irq_num >= 0) && (irq_num < MAX_NUM_IRQ))
{
im = 1 << irq_num;
reg = CP0_SR_read();
reg |= (SR_MASK_IM & (im << 8));
CP0_SR_write(reg);
}
}
void interrupt_disable(int irq_num)
{
reg_t reg, im;
if ((irq_num >= 0) && (irq_num < MAX_NUM_IRQ))
{
im = 1 << irq_num;
reg = CP0_SR_read();
reg &= ~(SR_MASK_IM & (im << 8));
CP0_SR_write(reg);
}
}
void interrupt_set(int irq_num)
{
reg_t reg, ip;
if ((irq_num >= 0) && (irq_num < MAX_NUM_IRQ))
{
ip = 1 << irq_num;
reg = CP0_CR_read();
reg |= (CR_MASK_IP & (ip << 8));
CP0_CR_write(reg);
}
}
void interrupt_clr(int irq_num)
{
reg_t reg, ip;
if ((irq_num >= 0) && (irq_num < MAX_NUM_IRQ))
{
ip = 1 << irq_num;
reg = CP0_CR_read();
reg &= ~(CR_MASK_IP & (ip << 8));
CP0_CR_write(reg);
}
}

Some files were not shown because too many files have changed in this diff Show More