611 Commits
Author SHA1 Message Date
jens 71020198e4 - use new bootloader v2.02
git-svn-id: http://moon:8086/svn/vhdl/trunk@1639 cc03376c-175c-47c8-b038-4cd826a8556b
2021-11-22 21:28:11 +00:00
jens 66f1340c35 - more mem
- new hello.elf

git-svn-id: http://moon:8086/svn/vhdl/trunk@1638 cc03376c-175c-47c8-b038-4cd826a8556b
2021-04-07 20:56:48 +00:00
jens 0ee3ddfd03 - removed premature test end
git-svn-id: http://moon:8086/svn/vhdl/trunk@1637 cc03376c-175c-47c8-b038-4cd826a8556b
2021-04-06 14:29:09 +00:00
jens 4b742dd23b - added CRLF
git-svn-id: http://moon:8086/svn/vhdl/trunk@1636 cc03376c-175c-47c8-b038-4cd826a8556b
2021-04-04 17:31:48 +00:00
jens cbf5100a16 - added
git-svn-id: http://moon:8086/svn/vhdl/trunk@1635 cc03376c-175c-47c8-b038-4cd826a8556b
2021-04-04 09:09:01 +00:00
jens dd51f49d5b - fixed syntax error
git-svn-id: http://moon:8086/svn/vhdl/trunk@1634 cc03376c-175c-47c8-b038-4cd826a8556b
2021-04-04 09:06:53 +00:00
jens 64c6a3004d - added uart_puts
git-svn-id: http://moon:8086/svn/vhdl/trunk@1633 cc03376c-175c-47c8-b038-4cd826a8556b
2021-04-04 09:01:49 +00:00
jens 04c0284ca7 - don't create any vars in packages
git-svn-id: http://moon:8086/svn/vhdl/trunk@1632 cc03376c-175c-47c8-b038-4cd826a8556b
2021-04-04 08:59:02 +00:00
jens c22bd92d64 - use symbolic names
git-svn-id: http://moon:8086/svn/vhdl/trunk@1631 cc03376c-175c-47c8-b038-4cd826a8556b
2021-04-04 08:58:15 +00:00
jens cbd6a1fa29 - added
git-svn-id: http://moon:8086/svn/vhdl/trunk@1630 cc03376c-175c-47c8-b038-4cd826a8556b
2021-04-04 08:57:50 +00:00
jens 8d0db9c098 - added
git-svn-id: http://moon:8086/svn/vhdl/trunk@1629 cc03376c-175c-47c8-b038-4cd826a8556b
2021-04-03 13:51:41 +00:00
jens 17e9bbad82 - fixed path to JCPU tools
git-svn-id: http://moon:8086/svn/vhdl/trunk@1628 cc03376c-175c-47c8-b038-4cd826a8556b
2021-04-03 13:50:20 +00:00
jens c211089a94 - added
git-svn-id: http://moon:8086/svn/vhdl/trunk@1627 cc03376c-175c-47c8-b038-4cd826a8556b
2021-04-03 13:13:48 +00:00
jens 28dcb864ae - refactored
git-svn-id: http://moon:8086/svn/vhdl/trunk@1626 cc03376c-175c-47c8-b038-4cd826a8556b
2021-04-03 13:09:19 +00:00
jens 33b91c2dfb - updated
git-svn-id: http://moon:8086/svn/vhdl/trunk@1625 cc03376c-175c-47c8-b038-4cd826a8556b
2021-04-03 13:06:39 +00:00
jens 1ed8ad5fdc - added
git-svn-id: http://moon:8086/svn/vhdl/trunk@1624 cc03376c-175c-47c8-b038-4cd826a8556b
2021-04-03 13:05:20 +00:00
jens 165500c739 - use single rst signal
git-svn-id: http://moon:8086/svn/vhdl/trunk@1623 cc03376c-175c-47c8-b038-4cd826a8556b
2021-04-03 09:03:19 +00:00
jens b037c0f6fc -opt_level 2
git-svn-id: http://moon:8086/svn/vhdl/trunk@1622 cc03376c-175c-47c8-b038-4cd826a8556b
2021-04-02 15:13:31 +00:00
jens c8384eb9f6 -opt_level 2
git-svn-id: http://moon:8086/svn/vhdl/trunk@1621 cc03376c-175c-47c8-b038-4cd826a8556b
2021-04-02 15:05:27 +00:00
jens 484940f8de - removed latch pc_branch_take with latching signal 'branch_ce'
git-svn-id: http://moon:8086/svn/vhdl/trunk@1620 cc03376c-175c-47c8-b038-4cd826a8556b
2021-04-02 13:28:11 +00:00
jens 8e7477b83b - try to add clock buffer constraint
git-svn-id: http://moon:8086/svn/vhdl/trunk@1619 cc03376c-175c-47c8-b038-4cd826a8556b
2021-04-02 12:42:01 +00:00
jens 51f295d37f - JASM : fixed string literals
git-svn-id: http://moon:8086/svn/vhdl/trunk@1618 cc03376c-175c-47c8-b038-4cd826a8556b
2021-04-01 06:53:44 +00:00
jens 2721d59449 - fixed synth project after fifo refactoring
- used _ld roms

git-svn-id: http://moon:8086/svn/vhdl/trunk@1617 cc03376c-175c-47c8-b038-4cd826a8556b
2021-03-31 19:54:32 +00:00
jens 1864b98e55 - removed half-cycle register for pc.branch_take
- refactored

git-svn-id: http://moon:8086/svn/vhdl/trunk@1616 cc03376c-175c-47c8-b038-4cd826a8556b
2021-03-31 14:04:22 +00:00
jens 8af5e1a8a5 - added extra register for bus master fifos
git-svn-id: http://moon:8086/svn/vhdl/trunk@1615 cc03376c-175c-47c8-b038-4cd826a8556b
2021-03-31 12:07:35 +00:00
jens 9360547eab - FIFO: control extra read register using generic "add_extra_read_register". Default = false
git-svn-id: http://moon:8086/svn/vhdl/trunk@1614 cc03376c-175c-47c8-b038-4cd826a8556b
2021-03-31 10:18:26 +00:00
jens 556dc410f5 - fixed synth project after fifo refactoring
git-svn-id: http://moon:8086/svn/vhdl/trunk@1613 cc03376c-175c-47c8-b038-4cd826a8556b
2021-03-31 09:55:49 +00:00
jens fc50f1f9d3 - added read register stage to fifo
git-svn-id: http://moon:8086/svn/vhdl/trunk@1612 cc03376c-175c-47c8-b038-4cd826a8556b
2021-03-31 09:37:17 +00:00
jens c52c69e8fb - rfacored
git-svn-id: http://moon:8086/svn/vhdl/trunk@1611 cc03376c-175c-47c8-b038-4cd826a8556b
2021-03-31 09:30:21 +00:00
jens 83373bbae5 - fixed full write
git-svn-id: http://moon:8086/svn/vhdl/trunk@1610 cc03376c-175c-47c8-b038-4cd826a8556b
2021-03-31 09:25:35 +00:00
jens c922fbe961 - refacored
git-svn-id: http://moon:8086/svn/vhdl/trunk@1609 cc03376c-175c-47c8-b038-4cd826a8556b
2021-03-31 08:15:41 +00:00
jens 1970a91580 - FIFO: added reg_stage
git-svn-id: http://moon:8086/svn/vhdl/trunk@1608 cc03376c-175c-47c8-b038-4cd826a8556b
2021-03-31 08:01:43 +00:00
jens 4bce0d8107 - remove unrelated path
- default effort = high

git-svn-id: http://moon:8086/svn/vhdl/trunk@1607 cc03376c-175c-47c8-b038-4cd826a8556b
2021-03-30 15:42:52 +00:00
jens 7b0201b69c - added MPA_EFFORT, PAR_EFFORT. Default = med
git-svn-id: http://moon:8086/svn/vhdl/trunk@1606 cc03376c-175c-47c8-b038-4cd826a8556b
2021-03-30 15:26:40 +00:00
jens 11567d0f3d - reverted buggy xst settings
git-svn-id: http://moon:8086/svn/vhdl/trunk@1605 cc03376c-175c-47c8-b038-4cd826a8556b
2021-03-30 15:22:20 +00:00
jens d8f6070643 - reverted buggy blanking modification
git-svn-id: http://moon:8086/svn/vhdl/trunk@1604 cc03376c-175c-47c8-b038-4cd826a8556b
2021-03-30 15:21:08 +00:00
jens 0c46a7fe81 - reverted
git-svn-id: http://moon:8086/svn/vhdl/trunk@1603 cc03376c-175c-47c8-b038-4cd826a8556b
2021-03-30 14:34:27 +00:00
jens 3eeaa0a5f5 - fixed overwriting of gtkw files
git-svn-id: http://moon:8086/svn/vhdl/trunk@1602 cc03376c-175c-47c8-b038-4cd826a8556b
2021-03-30 12:40:10 +00:00
jens d7b4ade86c - also specify run time on command line
git-svn-id: http://moon:8086/svn/vhdl/trunk@1601 cc03376c-175c-47c8-b038-4cd826a8556b
2021-03-30 12:24:38 +00:00
jens 84ee9394fe - unrelate bus and cpu clock
git-svn-id: http://moon:8086/svn/vhdl/trunk@1600 cc03376c-175c-47c8-b038-4cd826a8556b
2021-03-30 09:50:28 +00:00
jens 92781859e1 - added more constraints
git-svn-id: http://moon:8086/svn/vhdl/trunk@1599 cc03376c-175c-47c8-b038-4cd826a8556b
2021-03-30 09:17:34 +00:00
jens 19eadde8da - use make/ise.mk
git-svn-id: http://moon:8086/svn/vhdl/trunk@1598 cc03376c-175c-47c8-b038-4cd826a8556b
2021-03-30 09:17:21 +00:00
jens 95a989a001 VGA: refactored clocks and resets
git-svn-id: http://moon:8086/svn/vhdl/trunk@1597 cc03376c-175c-47c8-b038-4cd826a8556b
2021-03-30 08:57:09 +00:00
jens 82f64d5e06 - fixed NETLIST_DIR
git-svn-id: http://moon:8086/svn/vhdl/trunk@1596 cc03376c-175c-47c8-b038-4cd826a8556b
2021-03-30 07:32:51 +00:00
jens 83315b4c17 - VGA backend: use synchronous resets
- VGA backend: proc_vga_color_out: keep color signals stable - reduce noise


git-svn-id: http://moon:8086/svn/vhdl/trunk@1595 cc03376c-175c-47c8-b038-4cd826a8556b
2021-03-30 07:20:00 +00:00
jens 24e5cb75cb VGA: refactored clocks and resets
git-svn-id: http://moon:8086/svn/vhdl/trunk@1594 cc03376c-175c-47c8-b038-4cd826a8556b
2021-03-30 07:11:37 +00:00
jens 756dc0ec5a VGA: refactored clocks and resets
git-svn-id: http://moon:8086/svn/vhdl/trunk@1593 cc03376c-175c-47c8-b038-4cd826a8556b
2021-03-30 06:50:08 +00:00
jens 5ffd02c06e - use correct char rom
- background is black per default

git-svn-id: http://moon:8086/svn/vhdl/trunk@1592 cc03376c-175c-47c8-b038-4cd826a8556b
2021-03-29 20:53:09 +00:00
jens d34a85dbd0 - added new VGA time specs
- fixed ts_vga_800_600_60

git-svn-id: http://moon:8086/svn/vhdl/trunk@1591 cc03376c-175c-47c8-b038-4cd826a8556b
2021-03-29 20:06:43 +00:00
jens 1aa4dcee1f - use correct rams for synthesis
git-svn-id: http://moon:8086/svn/vhdl/trunk@1590 cc03376c-175c-47c8-b038-4cd826a8556b
2021-03-29 19:43:27 +00:00
jens 99a3711411 - fixed timing issues
git-svn-id: http://moon:8086/svn/vhdl/trunk@1589 cc03376c-175c-47c8-b038-4cd826a8556b
2021-03-29 19:11:21 +00:00
jens 47c9f86bae added
git-svn-id: http://moon:8086/svn/vhdl/trunk@1588 cc03376c-175c-47c8-b038-4cd826a8556b
2021-03-29 17:55:39 +00:00
jens d32d1d090b - refactored
git-svn-id: http://moon:8086/svn/vhdl/trunk@1587 cc03376c-175c-47c8-b038-4cd826a8556b
2021-03-29 17:52:26 +00:00
jens a4b3c6cbb5 - use vga_ctrl_sys
git-svn-id: http://moon:8086/svn/vhdl/trunk@1586 cc03376c-175c-47c8-b038-4cd826a8556b
2021-03-29 17:47:13 +00:00
jens d1e884eb47 - fixed paths after refactoring
git-svn-id: http://moon:8086/svn/vhdl/trunk@1585 cc03376c-175c-47c8-b038-4cd826a8556b
2021-03-29 16:55:01 +00:00
jens e58772981a - fixed paths after refactoring
git-svn-id: http://moon:8086/svn/vhdl/trunk@1584 cc03376c-175c-47c8-b038-4cd826a8556b
2021-03-29 16:41:44 +00:00
jens 1f4de98cea - refactored
git-svn-id: http://moon:8086/svn/vhdl/trunk@1583 cc03376c-175c-47c8-b038-4cd826a8556b
2021-03-29 16:38:07 +00:00
jens 2808f7e893 - refactored clockgens
git-svn-id: http://moon:8086/svn/vhdl/trunk@1582 cc03376c-175c-47c8-b038-4cd826a8556b
2021-03-29 16:33:48 +00:00
jens e8863e01ba - refactored
git-svn-id: http://moon:8086/svn/vhdl/trunk@1581 cc03376c-175c-47c8-b038-4cd826a8556b
2021-03-29 16:29:02 +00:00
jens 1ddbed0820 - fixed ise.mk
- cleaned up project/vga_ctrl

git-svn-id: http://moon:8086/svn/vhdl/trunk@1580 cc03376c-175c-47c8-b038-4cd826a8556b
2021-03-29 16:08:49 +00:00
jens d9db6eed75 - update
git-svn-id: http://moon:8086/svn/vhdl/trunk@1579 cc03376c-175c-47c8-b038-4cd826a8556b
2021-03-29 14:19:41 +00:00
jens f538cb1577 - removed sys_vga_clk_out
git-svn-id: http://moon:8086/svn/vhdl/trunk@1578 cc03376c-175c-47c8-b038-4cd826a8556b
2021-03-29 14:18:11 +00:00
jens bd5ea68dda - improved tools install
git-svn-id: http://moon:8086/svn/vhdl/trunk@1577 cc03376c-175c-47c8-b038-4cd826a8556b
2021-03-29 14:17:51 +00:00
jens c1e96aecba - fixed rst
- use main_sim for test bench

git-svn-id: http://moon:8086/svn/vhdl/trunk@1576 cc03376c-175c-47c8-b038-4cd826a8556b
2021-03-29 14:14:22 +00:00
jens c34cdf77ac - added main_sim
- added docs

git-svn-id: http://moon:8086/svn/vhdl/trunk@1575 cc03376c-175c-47c8-b038-4cd826a8556b
2021-03-29 14:11:00 +00:00
jens 905ec4a05e - fixed path
git-svn-id: http://moon:8086/svn/vhdl/trunk@1574 cc03376c-175c-47c8-b038-4cd826a8556b
2021-03-29 14:06:17 +00:00
jens 15da56174f - fixed opc.list not found
git-svn-id: http://moon:8086/svn/vhdl/trunk@1573 cc03376c-175c-47c8-b038-4cd826a8556b
2021-03-29 13:37:02 +00:00
jens 7467d81909 - improved
git-svn-id: http://moon:8086/svn/vhdl/trunk@1572 cc03376c-175c-47c8-b038-4cd826a8556b
2021-03-29 13:28:52 +00:00
jens e803bf494d - added Makefile
git-svn-id: http://moon:8086/svn/vhdl/trunk@1571 cc03376c-175c-47c8-b038-4cd826a8556b
2021-03-29 13:19:13 +00:00
jens cfe212249a - added
git-svn-id: http://moon:8086/svn/vhdl/trunk@1570 cc03376c-175c-47c8-b038-4cd826a8556b
2021-03-29 13:14:50 +00:00
jens f9051bc51c - refactored ISE makefiles
git-svn-id: http://moon:8086/svn/vhdl/trunk@1569 cc03376c-175c-47c8-b038-4cd826a8556b
2021-03-29 12:49:42 +00:00
jens 14ff542f7a - fixed contention cg_draw
git-svn-id: http://moon:8086/svn/vhdl/trunk@1568 cc03376c-175c-47c8-b038-4cd826a8556b
2021-03-29 10:48:07 +00:00
jens 7efce56819 - fixed cpu_rst
git-svn-id: http://moon:8086/svn/vhdl/trunk@1567 cc03376c-175c-47c8-b038-4cd826a8556b
2021-03-29 09:10:34 +00:00
jens 51899a014d - fixed
git-svn-id: http://moon:8086/svn/vhdl/trunk@1566 cc03376c-175c-47c8-b038-4cd826a8556b
2021-03-29 08:39:50 +00:00
jens 736cf3464d - fixed
git-svn-id: http://moon:8086/svn/vhdl/trunk@1565 cc03376c-175c-47c8-b038-4cd826a8556b
2021-03-29 08:39:24 +00:00
jens 5dad6f21b4 - fixed lowercase bug
git-svn-id: http://moon:8086/svn/vhdl/trunk@1564 cc03376c-175c-47c8-b038-4cd826a8556b
2021-03-29 08:33:41 +00:00
jens b99fc27ccc - fixed paths
git-svn-id: http://moon:8086/svn/vhdl/trunk@1563 cc03376c-175c-47c8-b038-4cd826a8556b
2021-03-28 18:28:34 +00:00
jens dda7811902 - fixed mips_sys after refactoring
git-svn-id: http://moon:8086/svn/vhdl/trunk@1562 cc03376c-175c-47c8-b038-4cd826a8556b
2021-03-28 18:02:48 +00:00
jens 3803aa154c - refactored
git-svn-id: http://moon:8086/svn/vhdl/trunk@1561 cc03376c-175c-47c8-b038-4cd826a8556b
2021-03-28 17:53:06 +00:00
jens d3b0f59c8b - use lower case for WAVE_FORMAT
git-svn-id: http://moon:8086/svn/vhdl/trunk@1560 cc03376c-175c-47c8-b038-4cd826a8556b
2021-03-28 17:45:33 +00:00
jens 0f7a8fb950 - removed old wave select
git-svn-id: http://moon:8086/svn/vhdl/trunk@1559 cc03376c-175c-47c8-b038-4cd826a8556b
2021-03-28 17:38:25 +00:00
jens d0677069e1 - update gtkw
git-svn-id: http://moon:8086/svn/vhdl/trunk@1558 cc03376c-175c-47c8-b038-4cd826a8556b
2021-03-28 17:26:05 +00:00
jens a9da9b8d3d - changed wave format selection
git-svn-id: http://moon:8086/svn/vhdl/trunk@1557 cc03376c-175c-47c8-b038-4cd826a8556b
2021-03-28 17:25:49 +00:00
jens 3c29cd8d3f - updated gtkw
git-svn-id: http://moon:8086/svn/vhdl/trunk@1556 cc03376c-175c-47c8-b038-4cd826a8556b
2021-03-28 15:38:32 +00:00
jens 3b9576c520 - refactored
git-svn-id: http://moon:8086/svn/vhdl/trunk@1555 cc03376c-175c-47c8-b038-4cd826a8556b
2021-03-28 14:56:00 +00:00
jens a8e4af4484 - refactored
git-svn-id: http://moon:8086/svn/vhdl/trunk@1554 cc03376c-175c-47c8-b038-4cd826a8556b
2021-03-28 14:36:32 +00:00
jens f323c6fd7a - added
git-svn-id: http://moon:8086/svn/vhdl/trunk@1553 cc03376c-175c-47c8-b038-4cd826a8556b
2021-03-28 14:19:46 +00:00
jens 619807f898 - added vga_backend.inc (Zwischenstand)
git-svn-id: http://moon:8086/svn/vhdl/trunk@1552 cc03376c-175c-47c8-b038-4cd826a8556b
2021-03-28 14:18:52 +00:00
jens 6fd2570659 - refactored
git-svn-id: http://moon:8086/svn/vhdl/trunk@1551 cc03376c-175c-47c8-b038-4cd826a8556b
2021-03-28 14:18:09 +00:00
jens b9f08b774d - renamed
git-svn-id: http://moon:8086/svn/vhdl/trunk@1550 cc03376c-175c-47c8-b038-4cd826a8556b
2021-03-28 13:28:02 +00:00
jens 6984f03f6f - removed ROOT_PATH
- added templates for tb and package

git-svn-id: http://moon:8086/svn/vhdl/trunk@1549 cc03376c-175c-47c8-b038-4cd826a8556b
2021-03-28 13:27:25 +00:00
jens b4f968c7c4 - no disp-time
git-svn-id: http://moon:8086/svn/vhdl/trunk@1548 cc03376c-175c-47c8-b038-4cd826a8556b
2021-03-28 12:38:28 +00:00
jens 2e87c7c8e2 - added new targets
git-svn-id: http://moon:8086/svn/vhdl/trunk@1547 cc03376c-175c-47c8-b038-4cd826a8556b
2021-03-28 12:32:49 +00:00
jens 4b69580c5d - use FST
git-svn-id: http://moon:8086/svn/vhdl/trunk@1546 cc03376c-175c-47c8-b038-4cd826a8556b
2021-03-28 12:02:56 +00:00
jens 1d3ac60495 - fixed aysnc_def
git-svn-id: http://moon:8086/svn/vhdl/trunk@1545 cc03376c-175c-47c8-b038-4cd826a8556b
2021-03-28 11:22:24 +00:00
jens 795ca6b382 - added
git-svn-id: http://moon:8086/svn/vhdl/trunk@1544 cc03376c-175c-47c8-b038-4cd826a8556b
2021-03-28 11:07:17 +00:00
jens 881893fda3 - MIPS core pulls Fifos
git-svn-id: http://moon:8086/svn/vhdl/trunk@1543 cc03376c-175c-47c8-b038-4cd826a8556b
2021-03-28 10:42:44 +00:00
jens ef273a188a - fixed assigning SRC
git-svn-id: http://moon:8086/svn/vhdl/trunk@1542 cc03376c-175c-47c8-b038-4cd826a8556b
2021-03-28 10:35:35 +00:00
jens 06feba8f63 - refactored
git-svn-id: http://moon:8086/svn/vhdl/trunk@1541 cc03376c-175c-47c8-b038-4cd826a8556b
2021-03-28 10:27:33 +00:00
jens d0433ac19d - fixed and use emac_jbus
git-svn-id: http://moon:8086/svn/vhdl/trunk@1540 cc03376c-175c-47c8-b038-4cd826a8556b
2021-03-27 18:51:23 +00:00
jens 3a7cd38951 - added
git-svn-id: http://moon:8086/svn/vhdl/trunk@1539 cc03376c-175c-47c8-b038-4cd826a8556b
2021-03-27 18:47:07 +00:00
jens 8c656907f3 - refactored
git-svn-id: http://moon:8086/svn/vhdl/trunk@1538 cc03376c-175c-47c8-b038-4cd826a8556b
2021-03-26 16:40:32 +00:00
jens 7b2080f729 - fixed xst file
git-svn-id: http://moon:8086/svn/vhdl/trunk@1537 cc03376c-175c-47c8-b038-4cd826a8556b
2021-03-26 09:55:31 +00:00
jens 5f6b6097aa - deleted
git-svn-id: http://moon:8086/svn/vhdl/trunk@1536 cc03376c-175c-47c8-b038-4cd826a8556b
2021-03-25 13:19:10 +00:00
jens d7d8e55e83 - fixed paths after refactoring
git-svn-id: http://moon:8086/svn/vhdl/trunk@1535 cc03376c-175c-47c8-b038-4cd826a8556b
2021-03-25 12:54:39 +00:00
jens 93a4d8905d - added list target
- fixed path in ise project for MIPS netlist

git-svn-id: http://moon:8086/svn/vhdl/trunk@1534 cc03376c-175c-47c8-b038-4cd826a8556b
2021-03-25 12:42:10 +00:00
jens 1a346c73d9 - fixed paths after refactoring
git-svn-id: http://moon:8086/svn/vhdl/trunk@1533 cc03376c-175c-47c8-b038-4cd826a8556b
2021-03-24 20:18:09 +00:00
jens 4943c43e32 - fixed paths after refactoring
git-svn-id: http://moon:8086/svn/vhdl/trunk@1532 cc03376c-175c-47c8-b038-4cd826a8556b
2021-03-24 18:57:18 +00:00
jens 599726a7b2 - refactored
git-svn-id: http://moon:8086/svn/vhdl/trunk@1531 cc03376c-175c-47c8-b038-4cd826a8556b
2021-03-24 18:39:05 +00:00
jens ff4700093d - added
git-svn-id: http://moon:8086/svn/vhdl/trunk@1530 cc03376c-175c-47c8-b038-4cd826a8556b
2021-03-24 18:29:39 +00:00
jens 480214099c - added
git-svn-id: http://moon:8086/svn/vhdl/trunk@1529 cc03376c-175c-47c8-b038-4cd826a8556b
2021-03-24 18:24:22 +00:00
jens b3e02ac085 - refactored
git-svn-id: http://moon:8086/svn/vhdl/trunk@1528 cc03376c-175c-47c8-b038-4cd826a8556b
2021-03-24 18:19:19 +00:00
jens f72d1deb10 - added
git-svn-id: http://moon:8086/svn/vhdl/trunk@1527 cc03376c-175c-47c8-b038-4cd826a8556b
2021-03-24 18:19:03 +00:00
jens 0f36365c8f - refactored
git-svn-id: http://moon:8086/svn/vhdl/trunk@1526 cc03376c-175c-47c8-b038-4cd826a8556b
2021-03-24 17:00:28 +00:00
jens 47ec6a20ee - refactored
git-svn-id: http://moon:8086/svn/vhdl/trunk@1525 cc03376c-175c-47c8-b038-4cd826a8556b
2021-03-24 16:57:19 +00:00
jens c4cf1e850b - refactored
git-svn-id: http://moon:8086/svn/vhdl/trunk@1524 cc03376c-175c-47c8-b038-4cd826a8556b
2021-03-24 16:47:24 +00:00
jens f6813422d3 - refactored
git-svn-id: http://moon:8086/svn/vhdl/trunk@1523 cc03376c-175c-47c8-b038-4cd826a8556b
2021-03-24 16:46:18 +00:00
jens 1787a89840 - refactored
git-svn-id: http://moon:8086/svn/vhdl/trunk@1522 cc03376c-175c-47c8-b038-4cd826a8556b
2021-03-24 16:42:05 +00:00
jens 89ab6cb56c - touch gtkw
git-svn-id: http://moon:8086/svn/vhdl/trunk@1521 cc03376c-175c-47c8-b038-4cd826a8556b
2021-03-24 16:36:51 +00:00
jens 8c34443241 - added
git-svn-id: http://moon:8086/svn/vhdl/trunk@1520 cc03376c-175c-47c8-b038-4cd826a8556b
2021-03-24 16:33:53 +00:00
jens 44743f9de8 - added
git-svn-id: http://moon:8086/svn/vhdl/trunk@1519 cc03376c-175c-47c8-b038-4cd826a8556b
2021-03-24 13:53:25 +00:00
jens 638ce8aca6 - only update gtkw
git-svn-id: http://moon:8086/svn/vhdl/trunk@1518 cc03376c-175c-47c8-b038-4cd826a8556b
2021-03-24 13:52:59 +00:00
jens 3dcf4ac4ee - fixed path after refactoring
git-svn-id: http://moon:8086/svn/vhdl/trunk@1517 cc03376c-175c-47c8-b038-4cd826a8556b
2021-03-24 13:31:37 +00:00
jens 7d85a6682c - moved
- fixed

git-svn-id: http://moon:8086/svn/vhdl/trunk@1516 cc03376c-175c-47c8-b038-4cd826a8556b
2021-03-24 13:28:32 +00:00
jens 7dd115a77b - added run_wave target
git-svn-id: http://moon:8086/svn/vhdl/trunk@1515 cc03376c-175c-47c8-b038-4cd826a8556b
2021-03-24 13:07:29 +00:00
jens 9c3fdb9862 - ghdl.mk copygtkw to build
- added mrproper

git-svn-id: http://moon:8086/svn/vhdl/trunk@1514 cc03376c-175c-47c8-b038-4cd826a8556b
2021-03-24 13:02:03 +00:00
jens 5e1f2c0642 - added Makefile which calls all *.make
- fixed paths after refactoring


git-svn-id: http://moon:8086/svn/vhdl/trunk@1513 cc03376c-175c-47c8-b038-4cd826a8556b
2021-03-24 12:53:51 +00:00
jens 3bb2a235f5 - moved rams to delete
git-svn-id: http://moon:8086/svn/vhdl/trunk@1512 cc03376c-175c-47c8-b038-4cd826a8556b
2021-03-24 11:44:43 +00:00
jens a7b7a37fe6 - refactored
git-svn-id: http://moon:8086/svn/vhdl/trunk@1511 cc03376c-175c-47c8-b038-4cd826a8556b
2021-03-24 11:39:09 +00:00
jens 9d6ab7b156 - fixed bounds check error
git-svn-id: http://moon:8086/svn/vhdl/trunk@1510 cc03376c-175c-47c8-b038-4cd826a8556b
2021-03-24 10:11:06 +00:00
jens 018cb85f4b - added
git-svn-id: http://moon:8086/svn/vhdl/trunk@1509 cc03376c-175c-47c8-b038-4cd826a8556b
2021-03-24 10:10:41 +00:00
jens 36e1738f34 - added COMPONENT declaration for mt46v16m16
git-svn-id: http://moon:8086/svn/vhdl/trunk@1508 cc03376c-175c-47c8-b038-4cd826a8556b
2021-03-24 09:31:51 +00:00
jens 3b79938452 - use MOD_PATH
git-svn-id: http://moon:8086/svn/vhdl/trunk@1507 cc03376c-175c-47c8-b038-4cd826a8556b
2021-03-24 09:30:56 +00:00
jens 2dd7abc098 - added ghdl tb
git-svn-id: http://moon:8086/svn/vhdl/trunk@1506 cc03376c-175c-47c8-b038-4cd826a8556b
2021-03-23 21:28:49 +00:00
jens 93ffa53c60 - added ghdl make for unisim
- refactored

git-svn-id: http://moon:8086/svn/vhdl/trunk@1505 cc03376c-175c-47c8-b038-4cd826a8556b
2021-03-23 21:19:25 +00:00
jens 5df39993c6 - refactored
git-svn-id: http://moon:8086/svn/vhdl/trunk@1504 cc03376c-175c-47c8-b038-4cd826a8556b
2021-03-23 20:38:52 +00:00
jens cb6cb78ea2 - refactored
git-svn-id: http://moon:8086/svn/vhdl/trunk@1503 cc03376c-175c-47c8-b038-4cd826a8556b
2021-03-23 18:47:15 +00:00
jens ebe4306954 - changed targets
git-svn-id: http://moon:8086/svn/vhdl/trunk@1502 cc03376c-175c-47c8-b038-4cd826a8556b
2021-03-23 17:43:46 +00:00
jens 165f0a4d91 - added
git-svn-id: http://moon:8086/svn/vhdl/trunk@1501 cc03376c-175c-47c8-b038-4cd826a8556b
2021-03-23 17:31:55 +00:00
jens 562c2ea650 - run for 100 us
git-svn-id: http://moon:8086/svn/vhdl/trunk@1500 cc03376c-175c-47c8-b038-4cd826a8556b
2021-03-23 17:28:43 +00:00
jens df2e491f6e - fixed DDC not bound
git-svn-id: http://moon:8086/svn/vhdl/trunk@1499 cc03376c-175c-47c8-b038-4cd826a8556b
2021-03-23 17:26:28 +00:00
jens 3625f3e441 - added tb_syn_ddc
- use CIC package

git-svn-id: http://moon:8086/svn/vhdl/trunk@1498 cc03376c-175c-47c8-b038-4cd826a8556b
2021-03-23 17:22:26 +00:00
jens 901475f64b - added
git-svn-id: http://moon:8086/svn/vhdl/trunk@1497 cc03376c-175c-47c8-b038-4cd826a8556b
2021-03-23 16:52:12 +00:00
jens 345dc15c72 - added CIC
git-svn-id: http://moon:8086/svn/vhdl/trunk@1496 cc03376c-175c-47c8-b038-4cd826a8556b
2021-03-23 15:19:54 +00:00
jens 7bb287e303 - added
git-svn-id: http://moon:8086/svn/vhdl/trunk@1495 cc03376c-175c-47c8-b038-4cd826a8556b
2021-03-23 15:08:51 +00:00
jens 98f2150ec7 - added DDC
git-svn-id: http://moon:8086/svn/vhdl/trunk@1494 cc03376c-175c-47c8-b038-4cd826a8556b
2021-03-23 15:00:54 +00:00
jens 5583170836 - fixed empty source list
git-svn-id: http://moon:8086/svn/vhdl/trunk@1493 cc03376c-175c-47c8-b038-4cd826a8556b
2021-03-23 14:54:56 +00:00
jens ce651be552 - refactored
git-svn-id: http://moon:8086/svn/vhdl/trunk@1492 cc03376c-175c-47c8-b038-4cd826a8556b
2021-03-23 14:49:15 +00:00
jens 6177a79e5a - removed redundant source
git-svn-id: http://moon:8086/svn/vhdl/trunk@1491 cc03376c-175c-47c8-b038-4cd826a8556b
2021-03-23 14:05:33 +00:00
jens 7944c546df - refactored
git-svn-id: http://moon:8086/svn/vhdl/trunk@1490 cc03376c-175c-47c8-b038-4cd826a8556b
2021-03-23 13:59:43 +00:00
jens 2e7c1bf9fd - updated
git-svn-id: http://moon:8086/svn/vhdl/trunk@1489 cc03376c-175c-47c8-b038-4cd826a8556b
2021-03-23 13:58:41 +00:00
jens af3f095306 - refactored
git-svn-id: http://moon:8086/svn/vhdl/trunk@1488 cc03376c-175c-47c8-b038-4cd826a8556b
2021-03-23 13:57:28 +00:00
jens bfa464ddb8 - refactored
git-svn-id: http://moon:8086/svn/vhdl/trunk@1487 cc03376c-175c-47c8-b038-4cd826a8556b
2021-03-23 13:44:32 +00:00
jens 5870d9af59 - refactored
git-svn-id: http://moon:8086/svn/vhdl/trunk@1486 cc03376c-175c-47c8-b038-4cd826a8556b
2021-03-23 13:34:11 +00:00
jens 19876a64f5 - refactored
git-svn-id: http://moon:8086/svn/vhdl/trunk@1485 cc03376c-175c-47c8-b038-4cd826a8556b
2021-03-23 13:29:16 +00:00
jens cd3b9bdb0f - refactored
git-svn-id: http://moon:8086/svn/vhdl/trunk@1484 cc03376c-175c-47c8-b038-4cd826a8556b
2021-03-23 11:46:32 +00:00
jens d249d20b50 - refactored
git-svn-id: http://moon:8086/svn/vhdl/trunk@1483 cc03376c-175c-47c8-b038-4cd826a8556b
2021-03-23 11:41:42 +00:00
jens a1df4a5323 - include packages
git-svn-id: http://moon:8086/svn/vhdl/trunk@1482 cc03376c-175c-47c8-b038-4cd826a8556b
2021-03-23 09:42:52 +00:00
jens cb3024c2ff - added
git-svn-id: http://moon:8086/svn/vhdl/trunk@1481 cc03376c-175c-47c8-b038-4cd826a8556b
2021-03-23 09:42:28 +00:00
jens 88e3c73665 - added gtkw
git-svn-id: http://moon:8086/svn/vhdl/trunk@1480 cc03376c-175c-47c8-b038-4cd826a8556b
2021-03-23 09:14:59 +00:00
jens 9a0571f6ce - added tb_emac_top_jb
git-svn-id: http://moon:8086/svn/vhdl/trunk@1479 cc03376c-175c-47c8-b038-4cd826a8556b
2021-03-23 09:08:54 +00:00
jens 48a6292f4c - removed duplicate files from SRCS list
git-svn-id: http://moon:8086/svn/vhdl/trunk@1478 cc03376c-175c-47c8-b038-4cd826a8556b
2021-03-23 09:08:25 +00:00
jens 1bc565b404 - added
git-svn-id: http://moon:8086/svn/vhdl/trunk@1477 cc03376c-175c-47c8-b038-4cd826a8556b
2021-03-23 08:25:47 +00:00
jens 16c9996524 - added
git-svn-id: http://moon:8086/svn/vhdl/trunk@1476 cc03376c-175c-47c8-b038-4cd826a8556b
2021-03-23 08:18:35 +00:00
jens fa2e213d8f - improved package files
git-svn-id: http://moon:8086/svn/vhdl/trunk@1475 cc03376c-175c-47c8-b038-4cd826a8556b
2021-03-23 07:49:42 +00:00
jens 82838a75ef - added more TBs
git-svn-id: http://moon:8086/svn/vhdl/trunk@1474 cc03376c-175c-47c8-b038-4cd826a8556b
2021-03-23 07:25:08 +00:00
jens 1a984690a6 - added fir semi parallel
git-svn-id: http://moon:8086/svn/vhdl/trunk@1473 cc03376c-175c-47c8-b038-4cd826a8556b
2021-03-23 07:10:51 +00:00
jens 3aa61449c3 - fixed bounds check error
git-svn-id: http://moon:8086/svn/vhdl/trunk@1472 cc03376c-175c-47c8-b038-4cd826a8556b
2021-03-23 07:10:12 +00:00
jens 2fd87cc940 - added fir parallel
git-svn-id: http://moon:8086/svn/vhdl/trunk@1471 cc03376c-175c-47c8-b038-4cd826a8556b
2021-03-23 06:56:23 +00:00
jens 1c21af3d1c - added
git-svn-id: http://moon:8086/svn/vhdl/trunk@1470 cc03376c-175c-47c8-b038-4cd826a8556b
2021-03-23 06:38:00 +00:00
jens d9427ed6e3 - added
git-svn-id: http://moon:8086/svn/vhdl/trunk@1469 cc03376c-175c-47c8-b038-4cd826a8556b
2021-03-22 20:34:53 +00:00
jens 44047cd580 - renameds
git-svn-id: http://moon:8086/svn/vhdl/trunk@1468 cc03376c-175c-47c8-b038-4cd826a8556b
2021-03-22 20:09:43 +00:00
jens 4a87b2b9bb - added
git-svn-id: http://moon:8086/svn/vhdl/trunk@1467 cc03376c-175c-47c8-b038-4cd826a8556b
2021-03-22 20:07:55 +00:00
jens 26f86652fa - refactored
git-svn-id: http://moon:8086/svn/vhdl/trunk@1466 cc03376c-175c-47c8-b038-4cd826a8556b
2021-03-22 20:05:15 +00:00
jens f42fa2e6a9 - added
git-svn-id: http://moon:8086/svn/vhdl/trunk@1465 cc03376c-175c-47c8-b038-4cd826a8556b
2021-03-22 20:02:14 +00:00
jens d022d78049 - refactored
git-svn-id: http://moon:8086/svn/vhdl/trunk@1464 cc03376c-175c-47c8-b038-4cd826a8556b
2021-03-22 19:58:54 +00:00
jens 057e6edb2d - renamed
git-svn-id: http://moon:8086/svn/vhdl/trunk@1463 cc03376c-175c-47c8-b038-4cd826a8556b
2021-03-22 18:59:21 +00:00
jens 6851dcf324 - renamed
git-svn-id: http://moon:8086/svn/vhdl/trunk@1462 cc03376c-175c-47c8-b038-4cd826a8556b
2021-03-22 18:57:12 +00:00
jens c3488bcd1a - renamed
git-svn-id: http://moon:8086/svn/vhdl/trunk@1461 cc03376c-175c-47c8-b038-4cd826a8556b
2021-03-22 18:55:10 +00:00
jens a962976b96 - renamed
git-svn-id: http://moon:8086/svn/vhdl/trunk@1460 cc03376c-175c-47c8-b038-4cd826a8556b
2021-03-22 18:51:22 +00:00
jens 4798698a38 - added nco_lut
git-svn-id: http://moon:8086/svn/vhdl/trunk@1459 cc03376c-175c-47c8-b038-4cd826a8556b
2021-03-22 18:36:36 +00:00
jens 03d6b84ac7 - added nco_cordic
git-svn-id: http://moon:8086/svn/vhdl/trunk@1458 cc03376c-175c-47c8-b038-4cd826a8556b
2021-03-22 18:31:14 +00:00
jens 1a8a2f6b8b - update
git-svn-id: http://moon:8086/svn/vhdl/trunk@1457 cc03376c-175c-47c8-b038-4cd826a8556b
2021-03-22 18:24:18 +00:00
jens 701cc392a0 - added
git-svn-id: http://moon:8086/svn/vhdl/trunk@1456 cc03376c-175c-47c8-b038-4cd826a8556b
2021-03-22 18:17:38 +00:00
jens e27233e516 - build patch version
git-svn-id: http://moon:8086/svn/vhdl/trunk@1455 cc03376c-175c-47c8-b038-4cd826a8556b
2021-03-22 17:55:54 +00:00
jens 2415e4c78b - added patch
git-svn-id: http://moon:8086/svn/vhdl/trunk@1454 cc03376c-175c-47c8-b038-4cd826a8556b
2021-03-22 17:44:08 +00:00
jens d049b5824e - moved
git-svn-id: http://moon:8086/svn/vhdl/trunk@1453 cc03376c-175c-47c8-b038-4cd826a8556b
2021-03-22 17:31:40 +00:00
jens 0d70374cd0 - moved
git-svn-id: http://moon:8086/svn/vhdl/trunk@1452 cc03376c-175c-47c8-b038-4cd826a8556b
2021-03-22 17:31:10 +00:00
jens 6ffb11b44b - reduced sim time
git-svn-id: http://moon:8086/svn/vhdl/trunk@1451 cc03376c-175c-47c8-b038-4cd826a8556b
2021-03-22 17:20:12 +00:00
jens 55b8103189 - reduced sim time
git-svn-id: http://moon:8086/svn/vhdl/trunk@1450 cc03376c-175c-47c8-b038-4cd826a8556b
2021-03-22 17:10:22 +00:00
jens ca5f96d996 - added and moved
git-svn-id: http://moon:8086/svn/vhdl/trunk@1449 cc03376c-175c-47c8-b038-4cd826a8556b
2021-03-22 16:28:30 +00:00
jens a5b3234e99 - added Makefile for eval_fixed_ja
git-svn-id: http://moon:8086/svn/vhdl/trunk@1448 cc03376c-175c-47c8-b038-4cd826a8556b
2021-03-22 13:15:42 +00:00
jens 096674ce14 - easily switch between lib variants
git-svn-id: http://moon:8086/svn/vhdl/trunk@1447 cc03376c-175c-47c8-b038-4cd826a8556b
2021-03-22 12:50:38 +00:00
jens 2857236623 - added
git-svn-id: http://moon:8086/svn/vhdl/trunk@1446 cc03376c-175c-47c8-b038-4cd826a8556b
2021-03-22 12:42:32 +00:00
jens 1ab613da24 - fixed WORK_DIR
git-svn-id: http://moon:8086/svn/vhdl/trunk@1445 cc03376c-175c-47c8-b038-4cd826a8556b
2021-03-22 08:24:21 +00:00
jens fcb43650e4 - fixed WORK_DIR
git-svn-id: http://moon:8086/svn/vhdl/trunk@1444 cc03376c-175c-47c8-b038-4cd826a8556b
2021-03-22 08:22:06 +00:00
jens be35445fdb - BUILD_DIR is overidable
git-svn-id: http://moon:8086/svn/vhdl/trunk@1443 cc03376c-175c-47c8-b038-4cd826a8556b
2021-03-22 07:38:26 +00:00
jens fd0972e5dd - JCPU: splitted into separate Makefiles
git-svn-id: http://moon:8086/svn/vhdl/trunk@1442 cc03376c-175c-47c8-b038-4cd826a8556b
2021-03-21 20:26:14 +00:00
jens 9837603ae1 - fixed makefile
- PCK_FIO is not needed

git-svn-id: http://moon:8086/svn/vhdl/trunk@1441 cc03376c-175c-47c8-b038-4cd826a8556b
2021-03-21 19:56:19 +00:00
jens f045dc1592 - added GHDL makefiles for cordic
git-svn-id: http://moon:8086/svn/vhdl/trunk@1440 cc03376c-175c-47c8-b038-4cd826a8556b
2021-03-21 18:36:23 +00:00
jens 272d7f0f7d - fixed ghdl.mk
- fixed fir_parallel Makefile 

git-svn-id: http://moon:8086/svn/vhdl/trunk@1439 cc03376c-175c-47c8-b038-4cd826a8556b
2021-03-21 18:16:11 +00:00
jens af8fb3b865 - bounds check failure with GHDL
git-svn-id: http://moon:8086/svn/vhdl/trunk@1438 cc03376c-175c-47c8-b038-4cd826a8556b
2021-03-21 17:20:23 +00:00
jens 3f1d7e4a15 - fixed makefile
git-svn-id: http://moon:8086/svn/vhdl/trunk@1437 cc03376c-175c-47c8-b038-4cd826a8556b
2021-03-21 16:37:51 +00:00
jens 84e83a7977 - fixed makefile
git-svn-id: http://moon:8086/svn/vhdl/trunk@1436 cc03376c-175c-47c8-b038-4cd826a8556b
2021-03-21 16:31:56 +00:00
jens 03d0e1a6b9 - fixed make.sh
git-svn-id: http://moon:8086/svn/vhdl/trunk@1435 cc03376c-175c-47c8-b038-4cd826a8556b
2021-03-21 16:23:23 +00:00
jens 270a1dbda9 - added missing file
git-svn-id: http://moon:8086/svn/vhdl/trunk@1434 cc03376c-175c-47c8-b038-4cd826a8556b
2021-03-21 16:17:35 +00:00
jens 0047d32755 - improved
git-svn-id: http://moon:8086/svn/vhdl/trunk@1433 cc03376c-175c-47c8-b038-4cd826a8556b
2021-03-21 16:02:35 +00:00
jens 85c1156549 - added missing IPF project files
- improved GHDL build script

git-svn-id: http://moon:8086/svn/vhdl/trunk@1432 cc03376c-175c-47c8-b038-4cd826a8556b
2021-03-21 15:38:01 +00:00
jens ed3b12acda - added ise project files
git-svn-id: http://moon:8086/svn/vhdl/trunk@1431 cc03376c-175c-47c8-b038-4cd826a8556b
2021-03-21 12:33:59 +00:00
jens 74e4af5fdf - added
git-svn-id: http://moon:8086/svn/vhdl/trunk@1430 cc03376c-175c-47c8-b038-4cd826a8556b
2021-03-21 12:20:54 +00:00
jens 2f7ab91e0d - added
git-svn-id: http://moon:8086/svn/vhdl/trunk@1429 cc03376c-175c-47c8-b038-4cd826a8556b
2021-03-21 12:04:37 +00:00
jens 9edf6a70af - added
git-svn-id: http://moon:8086/svn/vhdl/trunk@1428 cc03376c-175c-47c8-b038-4cd826a8556b
2021-03-21 11:48:32 +00:00
jens eed1090f2d - added
git-svn-id: http://moon:8086/svn/vhdl/trunk@1427 cc03376c-175c-47c8-b038-4cd826a8556b
2021-03-21 11:47:03 +00:00
jens 010c1d2b65 - added
git-svn-id: http://moon:8086/svn/vhdl/trunk@1426 cc03376c-175c-47c8-b038-4cd826a8556b
2021-03-21 11:45:58 +00:00
jens d0c4a3d800 - added
git-svn-id: http://moon:8086/svn/vhdl/trunk@1425 cc03376c-175c-47c8-b038-4cd826a8556b
2021-03-21 11:43:44 +00:00
jens bdb8fec295 - added
git-svn-id: http://moon:8086/svn/vhdl/trunk@1424 cc03376c-175c-47c8-b038-4cd826a8556b
2021-03-21 11:37:55 +00:00
jens 73cfd45401 - added
git-svn-id: http://moon:8086/svn/vhdl/trunk@1423 cc03376c-175c-47c8-b038-4cd826a8556b
2021-03-21 11:31:55 +00:00
jens 5309734167 - added
git-svn-id: http://moon:8086/svn/vhdl/trunk@1422 cc03376c-175c-47c8-b038-4cd826a8556b
2021-03-21 11:25:09 +00:00
jens 55ee041c08 - added
git-svn-id: http://moon:8086/svn/vhdl/trunk@1421 cc03376c-175c-47c8-b038-4cd826a8556b
2021-03-21 11:14:50 +00:00
jens e3aeadebf5 - added
git-svn-id: http://moon:8086/svn/vhdl/trunk@1420 cc03376c-175c-47c8-b038-4cd826a8556b
2021-03-21 11:09:13 +00:00
jens b06e84a2b7 - added
git-svn-id: http://moon:8086/svn/vhdl/trunk@1419 cc03376c-175c-47c8-b038-4cd826a8556b
2021-03-21 11:06:59 +00:00
jens 0a2abde8bf - added
git-svn-id: http://moon:8086/svn/vhdl/trunk@1418 cc03376c-175c-47c8-b038-4cd826a8556b
2021-03-21 11:05:13 +00:00
jens 097032e4d5 - added
git-svn-id: http://moon:8086/svn/vhdl/trunk@1417 cc03376c-175c-47c8-b038-4cd826a8556b
2021-03-21 11:01:11 +00:00
jens d61b3c2e0c - added
git-svn-id: http://moon:8086/svn/vhdl/trunk@1416 cc03376c-175c-47c8-b038-4cd826a8556b
2021-03-21 10:58:54 +00:00
jens 5af1242330 - added mac
git-svn-id: http://moon:8086/svn/vhdl/trunk@1415 cc03376c-175c-47c8-b038-4cd826a8556b
2021-03-21 10:51:05 +00:00
jens ea60299d26 - added
git-svn-id: http://moon:8086/svn/vhdl/trunk@1414 cc03376c-175c-47c8-b038-4cd826a8556b
2021-03-21 10:47:01 +00:00
jens 32440f7db9 moved
git-svn-id: http://moon:8086/svn/vhdl/trunk@1413 cc03376c-175c-47c8-b038-4cd826a8556b
2021-03-21 10:46:11 +00:00
jens 00ae5a7810 - added cordic
git-svn-id: http://moon:8086/svn/vhdl/trunk@1412 cc03376c-175c-47c8-b038-4cd826a8556b
2021-03-21 10:37:40 +00:00
jens 67d79572d7 - added ac97 Controller
git-svn-id: http://moon:8086/svn/vhdl/trunk@1411 cc03376c-175c-47c8-b038-4cd826a8556b
2021-03-21 09:07:16 +00:00
jens c24915c0ba - target run only runs simmulation without dumping anything for wave
- target wave runs with file dump for GTKwave

git-svn-id: http://moon:8086/svn/vhdl/trunk@1410 cc03376c-175c-47c8-b038-4cd826a8556b
2021-03-20 12:15:14 +00:00
jens 808f924277 - added FST
git-svn-id: http://moon:8086/svn/vhdl/trunk@1409 cc03376c-175c-47c8-b038-4cd826a8556b
2021-03-20 09:18:11 +00:00
jens 2650ac571e - run for 1500 us
git-svn-id: http://moon:8086/svn/vhdl/trunk@1408 cc03376c-175c-47c8-b038-4cd826a8556b
2021-03-20 09:07:13 +00:00
jens 503a275b6f - fixed GHDL warnings
git-svn-id: http://moon:8086/svn/vhdl/trunk@1407 cc03376c-175c-47c8-b038-4cd826a8556b
2021-03-20 08:55:13 +00:00
jens df5ede51c2 - use either VCD or GHW for sim and run
git-svn-id: http://moon:8086/svn/vhdl/trunk@1406 cc03376c-175c-47c8-b038-4cd826a8556b
2021-03-20 08:55:00 +00:00
jens 398b9be4c1 - load GHW and GTKW
git-svn-id: http://moon:8086/svn/vhdl/trunk@1405 cc03376c-175c-47c8-b038-4cd826a8556b
2021-03-20 08:17:04 +00:00
jens 82f44a02c8 - removed GHDL warnings
git-svn-id: http://moon:8086/svn/vhdl/trunk@1404 cc03376c-175c-47c8-b038-4cd826a8556b
2021-03-20 08:16:40 +00:00
jens 3302a57d0c - added GCC flags
git-svn-id: http://moon:8086/svn/vhdl/trunk@1403 cc03376c-175c-47c8-b038-4cd826a8556b
2021-03-19 18:42:48 +00:00
jens a7deab4d4b - added time-resolution
- added ignore

git-svn-id: http://moon:8086/svn/vhdl/trunk@1402 cc03376c-175c-47c8-b038-4cd826a8556b
2021-03-19 18:11:30 +00:00
jens 6f7fa8bd78 - added anaborate target
git-svn-id: http://moon:8086/svn/vhdl/trunk@1401 cc03376c-175c-47c8-b038-4cd826a8556b
2021-03-19 17:47:24 +00:00
jens 7cf6386cff - added mips package
- let tb end with assertion

git-svn-id: http://moon:8086/svn/vhdl/trunk@1400 cc03376c-175c-47c8-b038-4cd826a8556b
2021-03-19 15:37:38 +00:00
jens 0404c24bdc - added ghdl
git-svn-id: http://moon:8086/svn/vhdl/trunk@1399 cc03376c-175c-47c8-b038-4cd826a8556b
2021-03-19 15:34:19 +00:00
jens 356125d58d - also write vcd
git-svn-id: http://moon:8086/svn/vhdl/trunk@1398 cc03376c-175c-47c8-b038-4cd826a8556b
2021-03-19 15:23:16 +00:00
jens 3846de5ae3 - moved to ghdl
git-svn-id: http://moon:8086/svn/vhdl/trunk@1397 cc03376c-175c-47c8-b038-4cd826a8556b
2021-03-19 14:44:53 +00:00
jens bfbed487d5 - fixed jasm
git-svn-id: http://moon:8086/svn/vhdl/trunk@1396 cc03376c-175c-47c8-b038-4cd826a8556b
2021-03-19 14:41:08 +00:00
jens 697150b619 - reduced verbosity
git-svn-id: http://moon:8086/svn/vhdl/trunk@1395 cc03376c-175c-47c8-b038-4cd826a8556b
2021-03-19 13:35:58 +00:00
jens ea06df8e15 - added
git-svn-id: http://moon:8086/svn/vhdl/trunk@1394 cc03376c-175c-47c8-b038-4cd826a8556b
2021-03-19 13:35:22 +00:00
jens 201c5d54de - fixed path
git-svn-id: http://moon:8086/svn/vhdl/trunk@1393 cc03376c-175c-47c8-b038-4cd826a8556b
2021-03-19 13:35:03 +00:00
jens 9cf0030fe8 - fixed jasm to use with ruby > v1.9
git-svn-id: http://moon:8086/svn/vhdl/trunk@1392 cc03376c-175c-47c8-b038-4cd826a8556b
2021-03-19 13:28:03 +00:00
jens 73452b0abc - prepared synth target
git-svn-id: http://moon:8086/svn/vhdl/trunk@1391 cc03376c-175c-47c8-b038-4cd826a8556b
2021-03-19 11:42:32 +00:00
jens 5743284dbf - moved Makefile
git-svn-id: http://moon:8086/svn/vhdl/trunk@1390 cc03376c-175c-47c8-b038-4cd826a8556b
2021-03-19 11:14:51 +00:00
jens 9d6ff5fa17 - added makefiles for GHDL
git-svn-id: http://moon:8086/svn/vhdl/trunk@1389 cc03376c-175c-47c8-b038-4cd826a8556b
2021-03-19 11:07:39 +00:00
jens c5d7d2fe3b - fixed issues with GHDL
- fixed not closing file

git-svn-id: http://moon:8086/svn/vhdl/trunk@1388 cc03376c-175c-47c8-b038-4cd826a8556b
2021-03-19 11:06:38 +00:00
jens 88975a56a0 - added GHDL make stuff
git-svn-id: http://moon:8086/svn/vhdl/trunk@1387 cc03376c-175c-47c8-b038-4cd826a8556b
2021-03-19 11:05:04 +00:00
jens f84cdc7e6b - automatically build netlist in /lib/MIPS/syn
- fixed path to bootloader ROM


git-svn-id: http://moon:8086/svn/vhdl/trunk@1386 cc03376c-175c-47c8-b038-4cd826a8556b
2021-03-18 16:34:29 +00:00
jens 3419540ef7 [DE0-Nano]
- use PLL clock output for feed back

git-svn-id: http://moon:8086/svn/vhdl/trunk@1385 cc03376c-175c-47c8-b038-4cd826a8556b
2017-02-05 11:24:50 +00:00
jens 35c1a4e010 [DE0-Nano]
- derive sys_clk from PLL

git-svn-id: http://moon:8086/svn/vhdl/trunk@1384 cc03376c-175c-47c8-b038-4cd826a8556b
2017-02-05 11:10:29 +00:00
jens 364a66b1d3 - refactored clockgen for De0-nano
git-svn-id: http://moon:8086/svn/vhdl/trunk@1383 cc03376c-175c-47c8-b038-4cd826a8556b
2017-02-05 10:47:45 +00:00
jens 43e83aa8df [MIPS/ml402]
- fixed bootloader path

git-svn-id: http://moon:8086/svn/vhdl/trunk@1382 cc03376c-175c-47c8-b038-4cd826a8556b
2017-02-04 17:25:06 +00:00
jens e6767de381 [J-MIPS]
- I/D-Cache added input registers for data fetch


git-svn-id: http://moon:8086/svn/vhdl/trunk@1381 cc03376c-175c-47c8-b038-4cd826a8556b
2017-02-04 15:43:28 +00:00
jens 3fdaeaed48 [J-MIPS]
- D-Cache improved flush
- I-Cache improved flush


git-svn-id: http://moon:8086/svn/vhdl/trunk@1380 cc03376c-175c-47c8-b038-4cd826a8556b
2017-02-04 10:16:49 +00:00
jens 46e8e2d093 [DE0-Nano]
- added dip switches

git-svn-id: http://moon:8086/svn/vhdl/trunk@1379 cc03376c-175c-47c8-b038-4cd826a8556b
2017-01-28 10:08:56 +00:00
jens 7a62a6f245 - moved to mips software
git-svn-id: http://moon:8086/svn/vhdl/trunk@1378 cc03376c-175c-47c8-b038-4cd826a8556b
2017-01-24 17:09:35 +00:00
jens 58b7ca02dd - deleted
git-svn-id: http://moon:8086/svn/vhdl/trunk@1377 cc03376c-175c-47c8-b038-4cd826a8556b
2017-01-24 17:02:21 +00:00
jens b182c161b0 [J-MIPS]
- fixed D-Cache invalidate-at
- D-Cache improved flush
- I-Cache improved flush


git-svn-id: http://moon:8086/svn/vhdl/trunk@1376 cc03376c-175c-47c8-b038-4cd826a8556b
2017-01-23 05:14:05 +00:00
jens dd930a0530 - increased sim time
git-svn-id: http://moon:8086/svn/vhdl/trunk@1375 cc03376c-175c-47c8-b038-4cd826a8556b
2017-01-23 05:12:47 +00:00
jens cb25248c3f [DE0-Nano]
- increased CPU reset duration

git-svn-id: http://moon:8086/svn/vhdl/trunk@1374 cc03376c-175c-47c8-b038-4cd826a8556b
2017-01-20 18:41:25 +00:00
jens 8043f0b373 - mips_cop: SR.IEC can also be written in user mode
git-svn-id: http://moon:8086/svn/vhdl/trunk@1373 cc03376c-175c-47c8-b038-4cd826a8556b
2017-01-20 18:40:50 +00:00
jens d5c30504ac [DE0-Nano]
- use dedicated bootloader

git-svn-id: http://moon:8086/svn/vhdl/trunk@1372 cc03376c-175c-47c8-b038-4cd826a8556b
2017-01-18 23:35:47 +00:00
jens 9e5fa1c972 - fixed uart sim
git-svn-id: http://moon:8086/svn/vhdl/trunk@1371 cc03376c-175c-47c8-b038-4cd826a8556b
2017-01-18 22:25:53 +00:00
jens 087210ce5c [DE0-Nano]
- cleaned up top level
- removed jtag regs
- added SPI clk to SDC

git-svn-id: http://moon:8086/svn/vhdl/trunk@1370 cc03376c-175c-47c8-b038-4cd826a8556b
2017-01-15 13:18:04 +00:00
jens ee807ecdc8 [BB-FIFO]
- improved TB

git-svn-id: http://moon:8086/svn/vhdl/trunk@1369 cc03376c-175c-47c8-b038-4cd826a8556b
2017-01-15 12:14:40 +00:00
jens 76c81bff41 [DE0-Nano]
- changed default hex file

git-svn-id: http://moon:8086/svn/vhdl/trunk@1368 cc03376c-175c-47c8-b038-4cd826a8556b
2017-01-12 16:33:32 +00:00
jens 5a2a217622 [DE0-Nano]
- added POR for CPU
- UART set to 460800 baud and added more FIFO depth

git-svn-id: http://moon:8086/svn/vhdl/trunk@1367 cc03376c-175c-47c8-b038-4cd826a8556b
2017-01-12 02:54:47 +00:00
jens 6e9407ef79 [DE0-Nano]
- reduce hard coded numbers

git-svn-id: http://moon:8086/svn/vhdl/trunk@1366 cc03376c-175c-47c8-b038-4cd826a8556b
2017-01-11 08:09:41 +00:00
jens 652dfe00a2 [Uart_wb]
- fixed: f_sysclk is in MHz

git-svn-id: http://moon:8086/svn/vhdl/trunk@1365 cc03376c-175c-47c8-b038-4cd826a8556b
2017-01-11 08:08:40 +00:00
jens 7f91449b94 [DE0-Nano]
- added 2nd uart

git-svn-id: http://moon:8086/svn/vhdl/trunk@1364 cc03376c-175c-47c8-b038-4cd826a8556b
2017-01-07 15:34:40 +00:00
jens 84363d2734 [J-Uart]
- fixed receiver


git-svn-id: http://moon:8086/svn/vhdl/trunk@1363 cc03376c-175c-47c8-b038-4cd826a8556b
2017-01-05 10:56:59 +00:00
jens 9d420b16d4 [ml402::mips_sys]
- use  jUart

git-svn-id: http://moon:8086/svn/vhdl/trunk@1362 cc03376c-175c-47c8-b038-4cd826a8556b
2017-01-04 18:26:52 +00:00
jens cb8367c67a [DE0-Nano]
- reduce uart buffer to introduce more delay (work around for bus timeout)

git-svn-id: http://moon:8086/svn/vhdl/trunk@1361 cc03376c-175c-47c8-b038-4cd826a8556b
2016-12-21 21:14:07 +00:00
jens ab321735e8 [J-Uart]
- fixed generic


git-svn-id: http://moon:8086/svn/vhdl/trunk@1360 cc03376c-175c-47c8-b038-4cd826a8556b
2016-12-21 20:36:09 +00:00
jens aefed52167 [DE0-Nano]
- fixed uart

git-svn-id: http://moon:8086/svn/vhdl/trunk@1359 cc03376c-175c-47c8-b038-4cd826a8556b
2016-12-21 19:58:45 +00:00
jens 9a188d8b8a [J-Uart]
- use LSB first for UART
- Uart_wb: added generic for default baudrate and fifo depth

git-svn-id: http://moon:8086/svn/vhdl/trunk@1358 cc03376c-175c-47c8-b038-4cd826a8556b
2016-12-21 19:58:11 +00:00
jens e76ab469ca [Mips@DE0-Nano]
- use JUART

git-svn-id: http://moon:8086/svn/vhdl/trunk@1357 cc03376c-175c-47c8-b038-4cd826a8556b
2016-12-20 23:12:49 +00:00
jens 3bfefe621d [UART]
- cleaned up

git-svn-id: http://moon:8086/svn/vhdl/trunk@1356 cc03376c-175c-47c8-b038-4cd826a8556b
2016-12-20 22:49:15 +00:00
jens 2440831a07 [UART]
- cleaned up

git-svn-id: http://moon:8086/svn/vhdl/trunk@1355 cc03376c-175c-47c8-b038-4cd826a8556b
2016-12-20 22:48:31 +00:00
jens 26ffec7f49 [UART]
- composed uart from uart_tx and uart_rx
- tb_uart tests uart

git-svn-id: http://moon:8086/svn/vhdl/trunk@1354 cc03376c-175c-47c8-b038-4cd826a8556b
2016-12-20 22:46:48 +00:00
jens c5d08ec384 [UART]
- added UART with FIFO

git-svn-id: http://moon:8086/svn/vhdl/trunk@1353 cc03376c-175c-47c8-b038-4cd826a8556b
2016-12-20 20:36:04 +00:00
jens e4da80768a [JUART]
- renamed ports

git-svn-id: http://moon:8086/svn/vhdl/trunk@1352 cc03376c-175c-47c8-b038-4cd826a8556b
2016-12-20 19:14:21 +00:00
jens 82a500a99b [JUART]
- renamed ports

git-svn-id: http://moon:8086/svn/vhdl/trunk@1351 cc03376c-175c-47c8-b038-4cd826a8556b
2016-12-20 19:09:45 +00:00
jens 9522e9e22e [BB-FIFO]
- fixed full and half full

git-svn-id: http://moon:8086/svn/vhdl/trunk@1350 cc03376c-175c-47c8-b038-4cd826a8556b
2016-12-20 18:30:10 +00:00
jens b8b6cfcd81 [BB-FIFO]
- renamed ports
- added quick 'n dirty half full

git-svn-id: http://moon:8086/svn/vhdl/trunk@1349 cc03376c-175c-47c8-b038-4cd826a8556b
2016-12-19 18:55:37 +00:00
jens 4cd0065434 [BB-FIFO]
- even nicer

git-svn-id: http://moon:8086/svn/vhdl/trunk@1348 cc03376c-175c-47c8-b038-4cd826a8556b
2016-12-19 18:36:04 +00:00
jens f1c3a17fa8 [BB-FIFO]
- now working

git-svn-id: http://moon:8086/svn/vhdl/trunk@1347 cc03376c-175c-47c8-b038-4cd826a8556b
2016-12-19 18:26:15 +00:00
jens 58dcfb0ea1 git-svn-id: http://moon:8086/svn/vhdl/trunk@1346 cc03376c-175c-47c8-b038-4cd826a8556b 2016-12-18 11:20:05 +00:00
jens b1156e2163 [JUART]
- better BAUD_DIV

git-svn-id: http://moon:8086/svn/vhdl/trunk@1345 cc03376c-175c-47c8-b038-4cd826a8556b
2016-12-18 10:37:05 +00:00
jens 0300be76ce [JUART]
- self checking TB with incremented data

git-svn-id: http://moon:8086/svn/vhdl/trunk@1344 cc03376c-175c-47c8-b038-4cd826a8556b
2016-12-18 10:33:51 +00:00
jens 262d045890 [JUART]
- fixed RX incorrect behavior with BAUD_DIV > 1
- added baud rate generator to TB
- added TB with TX and RX

git-svn-id: http://moon:8086/svn/vhdl/trunk@1343 cc03376c-175c-47c8-b038-4cd826a8556b
2016-12-18 10:13:12 +00:00
jens f7af661eda [Uart]
- no auto reload for idle count
- removed hard coded numbers

git-svn-id: http://moon:8086/svn/vhdl/trunk@1342 cc03376c-175c-47c8-b038-4cd826a8556b
2016-12-18 00:12:24 +00:00
jens 3638a97abf - added J-UART
git-svn-id: http://moon:8086/svn/vhdl/trunk@1341 cc03376c-175c-47c8-b038-4cd826a8556b
2016-12-17 17:54:33 +00:00
jens c8567cfede [mips_de0_nano]
- initial import

git-svn-id: http://moon:8086/svn/vhdl/trunk@1340 cc03376c-175c-47c8-b038-4cd826a8556b
2016-11-26 14:43:26 +00:00
jens 8d2c3bc81b - use bootloader_flash
git-svn-id: http://moon:8086/svn/vhdl/trunk@1339 cc03376c-175c-47c8-b038-4cd826a8556b
2016-08-15 07:44:09 +00:00
jens a39f16486e - added
git-svn-id: http://moon:8086/svn/vhdl/trunk@1338 cc03376c-175c-47c8-b038-4cd826a8556b
2016-07-28 06:45:50 +00:00
jens d4be0af140 - added
git-svn-id: http://moon:8086/svn/vhdl/trunk@1337 cc03376c-175c-47c8-b038-4cd826a8556b
2016-07-28 06:44:49 +00:00
jens c78f82dd05 [MIPS]
- added MMU (Zwischenstand)

git-svn-id: http://moon:8086/svn/vhdl/trunk@1336 cc03376c-175c-47c8-b038-4cd826a8556b
2016-07-27 06:26:54 +00:00
jens 919293cab2 - added promgen
- use Cclk as startup clock


git-svn-id: http://moon:8086/svn/vhdl/trunk@1335 cc03376c-175c-47c8-b038-4cd826a8556b
2015-12-13 14:49:20 +00:00
jens b5bf49af28 [DDC]
- changed frequencies and adjusted CIC bit depths

git-svn-id: http://moon:8086/svn/vhdl/trunk@1334 cc03376c-175c-47c8-b038-4cd826a8556b
2015-12-13 13:19:37 +00:00
jens 9b50ec6a5b - test both 100 Mbps and 1000 Mbps
git-svn-id: http://moon:8086/svn/vhdl/trunk@1333 cc03376c-175c-47c8-b038-4cd826a8556b
2015-12-13 13:18:35 +00:00
jens 5d542e783b [Mips_sys]
- added GMII clock gen

git-svn-id: http://moon:8086/svn/vhdl/trunk@1332 cc03376c-175c-47c8-b038-4cd826a8556b
2015-12-13 13:12:56 +00:00
jens a6fe149b7a - fixed Gibabit ethernet
git-svn-id: http://moon:8086/svn/vhdl/trunk@1331 cc03376c-175c-47c8-b038-4cd826a8556b
2015-12-13 09:10:28 +00:00
jens 3897393a94 - set filter gain to unity
git-svn-id: http://moon:8086/svn/vhdl/trunk@1330 cc03376c-175c-47c8-b038-4cd826a8556b
2015-10-25 10:03:56 +00:00
jens eafe4bf00d - added
git-svn-id: http://moon:8086/svn/vhdl/trunk@1329 cc03376c-175c-47c8-b038-4cd826a8556b
2015-10-25 09:50:25 +00:00
jens a61b69bd79 - added
git-svn-id: http://moon:8086/svn/vhdl/trunk@1328 cc03376c-175c-47c8-b038-4cd826a8556b
2015-10-25 09:44:51 +00:00
jens d516ec5004 - deleted
git-svn-id: http://moon:8086/svn/vhdl/trunk@1327 cc03376c-175c-47c8-b038-4cd826a8556b
2015-10-25 08:23:27 +00:00
jens d2c79c26d0 deleted
git-svn-id: http://moon:8086/svn/vhdl/trunk@1326 cc03376c-175c-47c8-b038-4cd826a8556b
2015-10-25 08:16:34 +00:00
jens 47e7daee7d - fixed renamed package inclusion
- fixed problems after fixed_pkg update: explicit set round and saturation mode in Cordic and CIC

git-svn-id: http://moon:8086/svn/vhdl/trunk@1325 cc03376c-175c-47c8-b038-4cd826a8556b
2015-10-24 16:14:54 +00:00
jens b291a9f5a5 - added
git-svn-id: http://moon:8086/svn/vhdl/trunk@1324 cc03376c-175c-47c8-b038-4cd826a8556b
2015-10-24 16:12:48 +00:00
jens deb2fdbb90 - update fixed_pkg
git-svn-id: http://moon:8086/svn/vhdl/trunk@1323 cc03376c-175c-47c8-b038-4cd826a8556b
2015-10-24 14:56:24 +00:00
jens 6226f79562 - add generics for rounding mode and saturation mode
git-svn-id: http://moon:8086/svn/vhdl/trunk@1322 cc03376c-175c-47c8-b038-4cd826a8556b
2015-10-24 14:39:32 +00:00
jens e7e1b9118e - fixed valid signal
- fixed wav write

git-svn-id: http://moon:8086/svn/vhdl/trunk@1321 cc03376c-175c-47c8-b038-4cd826a8556b
2015-10-24 09:09:02 +00:00
jens ee627567f2 - fixed fir_stage_sys-based filters
git-svn-id: http://moon:8086/svn/vhdl/trunk@1320 cc03376c-175c-47c8-b038-4cd826a8556b
2015-10-24 08:39:35 +00:00
jens 34ef0ebe93 no vmap of lib
git-svn-id: http://moon:8086/svn/vhdl/trunk@1319 cc03376c-175c-47c8-b038-4cd826a8556b
2015-10-24 07:03:19 +00:00
jens 46e1bd322c - fixed fir_stage_sys
git-svn-id: http://moon:8086/svn/vhdl/trunk@1318 cc03376c-175c-47c8-b038-4cd826a8556b
2015-10-24 07:02:37 +00:00
jens 41d5b6e409 - fixed rams
git-svn-id: http://moon:8086/svn/vhdl/trunk@1317 cc03376c-175c-47c8-b038-4cd826a8556b
2015-10-23 05:50:48 +00:00
jens fff35dc404 no vmap of lib
git-svn-id: http://moon:8086/svn/vhdl/trunk@1316 cc03376c-175c-47c8-b038-4cd826a8556b
2015-10-23 05:49:32 +00:00
jens c3ed579118 deleted
git-svn-id: http://moon:8086/svn/vhdl/trunk@1315 cc03376c-175c-47c8-b038-4cd826a8556b
2015-10-23 05:44:17 +00:00
jens 9a27ebc627 no vmap of lib
git-svn-id: http://moon:8086/svn/vhdl/trunk@1314 cc03376c-175c-47c8-b038-4cd826a8556b
2015-10-23 05:43:53 +00:00
jens e476537d89 deleted
git-svn-id: http://moon:8086/svn/vhdl/trunk@1313 cc03376c-175c-47c8-b038-4cd826a8556b
2015-10-23 05:41:15 +00:00
jens 1f37f0bfce no vmap of lib
git-svn-id: http://moon:8086/svn/vhdl/trunk@1312 cc03376c-175c-47c8-b038-4cd826a8556b
2015-10-23 05:40:51 +00:00
jens 988c245f76 deleted
git-svn-id: http://moon:8086/svn/vhdl/trunk@1311 cc03376c-175c-47c8-b038-4cd826a8556b
2015-10-23 05:34:28 +00:00
jens d0e2af2ee7 - fixed rams
git-svn-id: http://moon:8086/svn/vhdl/trunk@1310 cc03376c-175c-47c8-b038-4cd826a8556b
2015-10-23 05:33:41 +00:00
jens 374566a294 - use correct rams
git-svn-id: http://moon:8086/svn/vhdl/trunk@1309 cc03376c-175c-47c8-b038-4cd826a8556b
2015-10-23 05:29:54 +00:00
jens 7fff4289e3 deleted
git-svn-id: http://moon:8086/svn/vhdl/trunk@1308 cc03376c-175c-47c8-b038-4cd826a8556b
2015-10-23 05:20:33 +00:00
jens 70c9bcb8bc no vmap of lib
git-svn-id: http://moon:8086/svn/vhdl/trunk@1307 cc03376c-175c-47c8-b038-4cd826a8556b
2015-10-23 05:20:05 +00:00
jens 61bcdc2caa no vmap of lib
git-svn-id: http://moon:8086/svn/vhdl/trunk@1306 cc03376c-175c-47c8-b038-4cd826a8556b
2015-10-23 05:19:18 +00:00
jens 951713990f no vmap of lib
git-svn-id: http://moon:8086/svn/vhdl/trunk@1305 cc03376c-175c-47c8-b038-4cd826a8556b
2015-10-23 04:52:27 +00:00
jens c229af0f71 - added ieee_proposed
git-svn-id: http://moon:8086/svn/vhdl/trunk@1304 cc03376c-175c-47c8-b038-4cd826a8556b
2015-10-23 04:43:48 +00:00
jens f862b2a5ae - always consume command
git-svn-id: http://moon:8086/svn/vhdl/trunk@1303 cc03376c-175c-47c8-b038-4cd826a8556b
2015-06-15 19:54:33 +00:00
jens ed3a943777 [spi_flash_wb.vhd]
- removed register interface
- first write data, then command

git-svn-id: http://moon:8086/svn/vhdl/trunk@1302 cc03376c-175c-47c8-b038-4cd826a8556b
2015-06-13 13:52:35 +00:00
jens 2b459949bb - fixed pipelined access
git-svn-id: http://moon:8086/svn/vhdl/trunk@1301 cc03376c-175c-47c8-b038-4cd826a8556b
2015-06-13 11:37:26 +00:00
jens bdf60c1304 - fixed
- reduced cache size in TB

git-svn-id: http://moon:8086/svn/vhdl/trunk@1300 cc03376c-175c-47c8-b038-4cd826a8556b
2015-06-13 10:28:23 +00:00
jens b22c3f79fa - fixed cache size dependent prefetch
git-svn-id: http://moon:8086/svn/vhdl/trunk@1299 cc03376c-175c-47c8-b038-4cd826a8556b
2015-06-13 10:14:56 +00:00
jens ad21a2febb - updated sim time
git-svn-id: http://moon:8086/svn/vhdl/trunk@1298 cc03376c-175c-47c8-b038-4cd826a8556b
2015-06-13 10:02:07 +00:00
jens f08e17b23f [spi_flash_wb.vhd]
- added caching

git-svn-id: http://moon:8086/svn/vhdl/trunk@1297 cc03376c-175c-47c8-b038-4cd826a8556b
2015-06-13 10:00:05 +00:00
jens c7eed7504d [spi_flash_wb.vhd]
- added caching

git-svn-id: http://moon:8086/svn/vhdl/trunk@1296 cc03376c-175c-47c8-b038-4cd826a8556b
2015-06-13 09:57:36 +00:00
jens f96a017bc7 [SPI master]
- added XFER Busy to status
- don't enqueue data or commands if in reset state

git-svn-id: http://moon:8086/svn/vhdl/trunk@1295 cc03376c-175c-47c8-b038-4cd826a8556b
2015-06-13 09:56:57 +00:00
jens ec40c08234 - added WB TB
git-svn-id: http://moon:8086/svn/vhdl/trunk@1294 cc03376c-175c-47c8-b038-4cd826a8556b
2015-06-11 16:58:46 +00:00
jens ed26cf7449 - updated
git-svn-id: http://moon:8086/svn/vhdl/trunk@1293 cc03376c-175c-47c8-b038-4cd826a8556b
2015-06-10 20:04:20 +00:00
jens 295095e2b0 - use SPI flash as SPI slave
git-svn-id: http://moon:8086/svn/vhdl/trunk@1292 cc03376c-175c-47c8-b038-4cd826a8556b
2015-06-10 20:01:26 +00:00
jens b19c4c2883 - added model
git-svn-id: http://moon:8086/svn/vhdl/trunk@1291 cc03376c-175c-47c8-b038-4cd826a8556b
2015-06-10 20:00:51 +00:00
jens 2edaa4d7cb - added models
git-svn-id: http://moon:8086/svn/vhdl/trunk@1290 cc03376c-175c-47c8-b038-4cd826a8556b
2015-06-10 19:27:35 +00:00
jens 8eb6b3ff9e - spi_master_wb: route through generics
git-svn-id: http://moon:8086/svn/vhdl/trunk@1289 cc03376c-175c-47c8-b038-4cd826a8556b
2015-06-04 20:27:50 +00:00
jens 53b731a4eb - read streaming with FIFO full wait
git-svn-id: http://moon:8086/svn/vhdl/trunk@1288 cc03376c-175c-47c8-b038-4cd826a8556b
2015-06-04 18:49:49 +00:00
jens 8f12925523 - addedtest with more than 32 bit read data
git-svn-id: http://moon:8086/svn/vhdl/trunk@1287 cc03376c-175c-47c8-b038-4cd826a8556b
2015-06-04 16:39:42 +00:00
jens 360bd90d0f - fixed read fifo clocks
git-svn-id: http://moon:8086/svn/vhdl/trunk@1286 cc03376c-175c-47c8-b038-4cd826a8556b
2015-06-04 16:16:18 +00:00
jens c9d75c5d52 - fixed spi reset
git-svn-id: http://moon:8086/svn/vhdl/trunk@1285 cc03376c-175c-47c8-b038-4cd826a8556b
2015-06-04 15:55:58 +00:00
jens 97543c8bbd - fixed cmd reg latching
git-svn-id: http://moon:8086/svn/vhdl/trunk@1284 cc03376c-175c-47c8-b038-4cd826a8556b
2015-06-04 15:30:09 +00:00
jens 84953b98b9 - added J-Bus interface
git-svn-id: http://moon:8086/svn/vhdl/trunk@1283 cc03376c-175c-47c8-b038-4cd826a8556b
2015-06-04 13:45:05 +00:00
jens bae4ed7e62 - fixed command size
git-svn-id: http://moon:8086/svn/vhdl/trunk@1282 cc03376c-175c-47c8-b038-4cd826a8556b
2015-06-04 13:44:21 +00:00
jens ca0b04c733 - increased CAT FIFO depth
git-svn-id: http://moon:8086/svn/vhdl/trunk@1281 cc03376c-175c-47c8-b038-4cd826a8556b
2015-06-04 12:36:45 +00:00
jens d1407db11d - added clock divider
- fixed clock edge of Slave TX

git-svn-id: http://moon:8086/svn/vhdl/trunk@1280 cc03376c-175c-47c8-b038-4cd826a8556b
2015-06-04 12:17:00 +00:00
jens 8097a4f41c - fixes after renaming
git-svn-id: http://moon:8086/svn/vhdl/trunk@1279 cc03376c-175c-47c8-b038-4cd826a8556b
2015-06-04 11:16:21 +00:00
jens 2f16cf461a - renamed
git-svn-id: http://moon:8086/svn/vhdl/trunk@1278 cc03376c-175c-47c8-b038-4cd826a8556b
2015-06-04 11:13:15 +00:00
jens 407a33db94 - renamed
git-svn-id: http://moon:8086/svn/vhdl/trunk@1277 cc03376c-175c-47c8-b038-4cd826a8556b
2015-06-04 11:12:48 +00:00
jens 6605ecc2ac - Master RX and TX working
git-svn-id: http://moon:8086/svn/vhdl/trunk@1276 cc03376c-175c-47c8-b038-4cd826a8556b
2015-06-04 11:09:56 +00:00
jens 7ad5c7f3c2 [SPI]
- use async. FIFOs

git-svn-id: http://moon:8086/svn/vhdl/trunk@1275 cc03376c-175c-47c8-b038-4cd826a8556b
2015-06-02 19:16:16 +00:00
jens fb41f345fa - use full address space
git-svn-id: http://moon:8086/svn/vhdl/trunk@1274 cc03376c-175c-47c8-b038-4cd826a8556b
2015-05-31 16:56:10 +00:00
jens 41f9574600 - added SPI (Zwischenstand)
git-svn-id: http://moon:8086/svn/vhdl/trunk@1273 cc03376c-175c-47c8-b038-4cd826a8556b
2015-05-31 16:44:51 +00:00
jens 4f08ade4e2 - fixed Piso data loss
git-svn-id: http://moon:8086/svn/vhdl/trunk@1272 cc03376c-175c-47c8-b038-4cd826a8556b
2015-05-31 10:13:33 +00:00
jens fd05664b04 - fixed A0
git-svn-id: http://moon:8086/svn/vhdl/trunk@1271 cc03376c-175c-47c8-b038-4cd826a8556b
2015-05-31 08:30:24 +00:00
jens c569ae0bf0 - fixed bad timing
git-svn-id: http://moon:8086/svn/vhdl/trunk@1270 cc03376c-175c-47c8-b038-4cd826a8556b
2015-05-30 18:33:56 +00:00
jens 1963853702 - fixed byte order on sub-word writes
git-svn-id: http://moon:8086/svn/vhdl/trunk@1269 cc03376c-175c-47c8-b038-4cd826a8556b
2015-05-30 16:35:13 +00:00
jens 621e5b1747 - fixed multiple drivers
git-svn-id: http://moon:8086/svn/vhdl/trunk@1268 cc03376c-175c-47c8-b038-4cd826a8556b
2015-05-30 14:09:05 +00:00
jens bca2359c65 - use BL=2
git-svn-id: http://moon:8086/svn/vhdl/trunk@1267 cc03376c-175c-47c8-b038-4cd826a8556b
2015-05-30 14:00:04 +00:00
jens dabea0e2ab - fixed write latency, which shall be zero
git-svn-id: http://moon:8086/svn/vhdl/trunk@1266 cc03376c-175c-47c8-b038-4cd826a8556b
2015-05-30 13:59:21 +00:00
jens 4016d60a4c - fixed port map
git-svn-id: http://moon:8086/svn/vhdl/trunk@1265 cc03376c-175c-47c8-b038-4cd826a8556b
2015-05-30 12:30:18 +00:00
jens 0e0a7e48a6 - reworked PISO and SIPO
git-svn-id: http://moon:8086/svn/vhdl/trunk@1264 cc03376c-175c-47c8-b038-4cd826a8556b
2015-05-30 12:27:45 +00:00
jens 99b30ba0cc - adde SIPO and PISO
git-svn-id: http://moon:8086/svn/vhdl/trunk@1263 cc03376c-175c-47c8-b038-4cd826a8556b
2015-05-30 12:27:20 +00:00
jens 5e4798bbab - minor change
git-svn-id: http://moon:8086/svn/vhdl/trunk@1262 cc03376c-175c-47c8-b038-4cd826a8556b
2015-05-30 09:07:50 +00:00
jens ec35a40898 - simplified PHY control signals
git-svn-id: http://moon:8086/svn/vhdl/trunk@1261 cc03376c-175c-47c8-b038-4cd826a8556b
2015-05-30 09:07:36 +00:00
jens 4646c2ef34 - simplified PHY control signals
- revert apparent BURST fix

git-svn-id: http://moon:8086/svn/vhdl/trunk@1260 cc03376c-175c-47c8-b038-4cd826a8556b
2015-05-30 08:31:08 +00:00
jens b2c5bcb279 - minor changes to frontend
- increased POWER_UP wait
- added reset delay

git-svn-id: http://moon:8086/svn/vhdl/trunk@1259 cc03376c-175c-47c8-b038-4cd826a8556b
2015-05-29 19:18:52 +00:00
jens ae98d5f2d3 - added
git-svn-id: http://moon:8086/svn/vhdl/trunk@1258 cc03376c-175c-47c8-b038-4cd826a8556b
2015-05-29 19:16:53 +00:00
jens 9b65c9429e - added altera_mf
git-svn-id: http://moon:8086/svn/vhdl/trunk@1257 cc03376c-175c-47c8-b038-4cd826a8556b
2015-05-29 13:15:53 +00:00
jens bd1bb90bb0 - added Altera/De0-NAno implementation
git-svn-id: http://moon:8086/svn/vhdl/trunk@1256 cc03376c-175c-47c8-b038-4cd826a8556b
2015-05-29 13:15:30 +00:00
jens 2da60e2b54 - added Altera/De0-NAno implementation
git-svn-id: http://moon:8086/svn/vhdl/trunk@1255 cc03376c-175c-47c8-b038-4cd826a8556b
2015-05-29 13:09:20 +00:00
jens 4afbac8e59 - added altera_mf
- fixed compile scripts

git-svn-id: http://moon:8086/svn/vhdl/trunk@1254 cc03376c-175c-47c8-b038-4cd826a8556b
2015-05-29 11:06:47 +00:00
jens a5bd5bf099 - update
git-svn-id: http://moon:8086/svn/vhdl/trunk@1253 cc03376c-175c-47c8-b038-4cd826a8556b
2015-05-28 08:44:58 +00:00
jens 8cac4b62d9 - fixed port map (Xilinx bug)
git-svn-id: http://moon:8086/svn/vhdl/trunk@1252 cc03376c-175c-47c8-b038-4cd826a8556b
2015-05-28 05:40:41 +00:00
jens 34b05078c4 - minor fix
git-svn-id: http://moon:8086/svn/vhdl/trunk@1251 cc03376c-175c-47c8-b038-4cd826a8556b
2015-05-27 20:26:11 +00:00
jens 6a777f0b86 - set TX-half full (S/W depends on it)
git-svn-id: http://moon:8086/svn/vhdl/trunk@1250 cc03376c-175c-47c8-b038-4cd826a8556b
2015-05-27 19:05:25 +00:00
jens b0c03c4449 - deleted
git-svn-id: http://moon:8086/svn/vhdl/trunk@1249 cc03376c-175c-47c8-b038-4cd826a8556b
2015-05-27 16:30:05 +00:00
jens b0a3645610 - fixed
git-svn-id: http://moon:8086/svn/vhdl/trunk@1248 cc03376c-175c-47c8-b038-4cd826a8556b
2015-05-27 16:29:27 +00:00
jens 84e492a1e8 [uart]
- fixed Xilinx implementation

git-svn-id: http://moon:8086/svn/vhdl/trunk@1247 cc03376c-175c-47c8-b038-4cd826a8556b
2015-05-27 16:28:42 +00:00
jens d4008485e3 - fixed
git-svn-id: http://moon:8086/svn/vhdl/trunk@1246 cc03376c-175c-47c8-b038-4cd826a8556b
2015-05-27 16:20:33 +00:00
jens 194720b817 - added uart_types to prj
git-svn-id: http://moon:8086/svn/vhdl/trunk@1245 cc03376c-175c-47c8-b038-4cd826a8556b
2015-05-27 16:19:15 +00:00
jens 8a7119fa2f - deleted
git-svn-id: http://moon:8086/svn/vhdl/trunk@1244 cc03376c-175c-47c8-b038-4cd826a8556b
2015-05-27 16:17:43 +00:00
jens f52494f466 - deleted
git-svn-id: http://moon:8086/svn/vhdl/trunk@1243 cc03376c-175c-47c8-b038-4cd826a8556b
2015-05-27 16:17:14 +00:00
jens 7aa1eefb79 - uart changes
- cleaned up prj

git-svn-id: http://moon:8086/svn/vhdl/trunk@1242 cc03376c-175c-47c8-b038-4cd826a8556b
2015-05-27 16:15:56 +00:00
jens 13488ae71e [UART]
- ctrl is input

git-svn-id: http://moon:8086/svn/vhdl/trunk@1241 cc03376c-175c-47c8-b038-4cd826a8556b
2015-05-27 15:59:43 +00:00
jens 6588eb752a - updated
git-svn-id: http://moon:8086/svn/vhdl/trunk@1240 cc03376c-175c-47c8-b038-4cd826a8556b
2015-05-27 15:59:10 +00:00
jens 11fa96a4e7 [Uart]
- uart_wb instantiates uart
- merged uart_tx, uart_rx into uart
- added uart implementations for Xilinx (kcuart) and Altera (JTAG)

git-svn-id: http://moon:8086/svn/vhdl/trunk@1239 cc03376c-175c-47c8-b038-4cd826a8556b
2015-05-27 15:50:32 +00:00
jens 4d598154ca - updated
git-svn-id: http://moon:8086/svn/vhdl/trunk@1238 cc03376c-175c-47c8-b038-4cd826a8556b
2015-05-26 17:27:01 +00:00
jens 4687df5154 - delete work on startup
git-svn-id: http://moon:8086/svn/vhdl/trunk@1237 cc03376c-175c-47c8-b038-4cd826a8556b
2015-05-26 17:24:53 +00:00
jens 3d9effde77 - reverted: disable gigabit ethernet by default
git-svn-id: http://moon:8086/svn/vhdl/trunk@1236 cc03376c-175c-47c8-b038-4cd826a8556b
2015-05-26 17:24:11 +00:00
jens 0c2fd3e928 - test: enable gigabit ethernet by default
git-svn-id: http://moon:8086/svn/vhdl/trunk@1235 cc03376c-175c-47c8-b038-4cd826a8556b
2015-05-26 16:48:56 +00:00
jens 5630152954 - deleted
git-svn-id: http://moon:8086/svn/vhdl/trunk@1234 cc03376c-175c-47c8-b038-4cd826a8556b
2015-05-26 14:47:07 +00:00
jens 1bc700a041 - generate CKE from SDRAM CMD fsm. Simplified interfaces
git-svn-id: http://moon:8086/svn/vhdl/trunk@1233 cc03376c-175c-47c8-b038-4cd826a8556b
2015-05-25 12:13:27 +00:00
jens ce79902c62 - fixed project files
git-svn-id: http://moon:8086/svn/vhdl/trunk@1232 cc03376c-175c-47c8-b038-4cd826a8556b
2015-05-25 11:48:26 +00:00
jens ca623db33b -added timing report
git-svn-id: http://moon:8086/svn/vhdl/trunk@1231 cc03376c-175c-47c8-b038-4cd826a8556b
2015-05-25 11:38:22 +00:00
jens 3edba6d5a7 - simplified CMD FSM
git-svn-id: http://moon:8086/svn/vhdl/trunk@1230 cc03376c-175c-47c8-b038-4cd826a8556b
2015-05-25 11:37:41 +00:00
jens d1893931ed - fixed cycle counter
git-svn-id: http://moon:8086/svn/vhdl/trunk@1229 cc03376c-175c-47c8-b038-4cd826a8556b
2015-05-25 10:51:06 +00:00
jens d0da5022ef [SDRAM CMD FSM]
- bugfix Burst mode

git-svn-id: http://moon:8086/svn/vhdl/trunk@1228 cc03376c-175c-47c8-b038-4cd826a8556b
2015-05-25 09:32:10 +00:00
jens be66661fe9 - fixed
git-svn-id: http://moon:8086/svn/vhdl/trunk@1227 cc03376c-175c-47c8-b038-4cd826a8556b
2015-05-25 08:14:53 +00:00
jens 44551d28fd - fixed
git-svn-id: http://moon:8086/svn/vhdl/trunk@1226 cc03376c-175c-47c8-b038-4cd826a8556b
2015-05-25 08:13:37 +00:00
jens 6ea540f7c7 - fixed project files
git-svn-id: http://moon:8086/svn/vhdl/trunk@1225 cc03376c-175c-47c8-b038-4cd826a8556b
2015-05-25 08:08:00 +00:00
jens 5fe93ed9ac - removed BURSTLEN from generics
- fixed burst counter
- fixed SDR PHY

git-svn-id: http://moon:8086/svn/vhdl/trunk@1224 cc03376c-175c-47c8-b038-4cd826a8556b
2015-05-25 08:03:05 +00:00
jens 5427d4cae0 - removed constants from sdram_types.vhd and put them to sdram_const.vhd
- define burst length in sdram_config

git-svn-id: http://moon:8086/svn/vhdl/trunk@1223 cc03376c-175c-47c8-b038-4cd826a8556b
2015-05-25 07:25:49 +00:00
jens 0a90acac6d - fixed read clock
git-svn-id: http://moon:8086/svn/vhdl/trunk@1222 cc03376c-175c-47c8-b038-4cd826a8556b
2015-05-24 18:43:27 +00:00
jens e20785fc1e - added TPD_BOARD_SIM for wb32
- TPD_BOARD_SIM is still in work for DDR PHY

git-svn-id: http://moon:8086/svn/vhdl/trunk@1221 cc03376c-175c-47c8-b038-4cd826a8556b
2015-05-24 18:29:28 +00:00
jens 3a234769af - update wave
git-svn-id: http://moon:8086/svn/vhdl/trunk@1220 cc03376c-175c-47c8-b038-4cd826a8556b
2015-05-24 18:27:52 +00:00
jens bfa747571f - added RPD_BOARD_SIM
- cleaned up
- reduced SDRAM CLock to 100 MHz

git-svn-id: http://moon:8086/svn/vhdl/trunk@1219 cc03376c-175c-47c8-b038-4cd826a8556b
2015-05-24 17:36:21 +00:00
jens 32f0d8c23a - model clock skew correctly
git-svn-id: http://moon:8086/svn/vhdl/trunk@1218 cc03376c-175c-47c8-b038-4cd826a8556b
2015-05-24 16:10:12 +00:00
jens 2005b700c1 - fixed clock
git-svn-id: http://moon:8086/svn/vhdl/trunk@1217 cc03376c-175c-47c8-b038-4cd826a8556b
2015-05-24 15:48:20 +00:00
jens 5beeee9fa7 - wave update
git-svn-id: http://moon:8086/svn/vhdl/trunk@1216 cc03376c-175c-47c8-b038-4cd826a8556b
2015-05-24 14:35:47 +00:00
jens ca5a2b4958 - wave update
git-svn-id: http://moon:8086/svn/vhdl/trunk@1215 cc03376c-175c-47c8-b038-4cd826a8556b
2015-05-24 14:33:40 +00:00
jens 5c1b83fb1e - fixed unconstrained array
git-svn-id: http://moon:8086/svn/vhdl/trunk@1214 cc03376c-175c-47c8-b038-4cd826a8556b
2015-05-24 14:33:27 +00:00
jens d5ff73eb3c - removed unused port signals
git-svn-id: http://moon:8086/svn/vhdl/trunk@1213 cc03376c-175c-47c8-b038-4cd826a8556b
2015-05-24 13:19:25 +00:00
jens 06bc5d193e - fixed timing in config
- fixed data drive

git-svn-id: http://moon:8086/svn/vhdl/trunk@1212 cc03376c-175c-47c8-b038-4cd826a8556b
2015-05-24 13:13:17 +00:00
jens bd65d611dd - adedd single data rate SDRAM
git-svn-id: http://moon:8086/svn/vhdl/trunk@1211 cc03376c-175c-47c8-b038-4cd826a8556b
2015-05-24 12:54:57 +00:00
jens fa8fadd8cc - renamed constants
git-svn-id: http://moon:8086/svn/vhdl/trunk@1210 cc03376c-175c-47c8-b038-4cd826a8556b
2015-05-24 11:43:38 +00:00
jens dfd8330e50 - removed hard coded constants
git-svn-id: http://moon:8086/svn/vhdl/trunk@1209 cc03376c-175c-47c8-b038-4cd826a8556b
2015-05-24 11:41:39 +00:00
jens 246d511246 - removed hard coded constants
git-svn-id: http://moon:8086/svn/vhdl/trunk@1208 cc03376c-175c-47c8-b038-4cd826a8556b
2015-05-24 11:40:30 +00:00
jens fa1bed5497 - removed hard coded constants
git-svn-id: http://moon:8086/svn/vhdl/trunk@1207 cc03376c-175c-47c8-b038-4cd826a8556b
2015-05-24 11:35:09 +00:00
jens 1b8dd20871 - removed hard coded constants
git-svn-id: http://moon:8086/svn/vhdl/trunk@1206 cc03376c-175c-47c8-b038-4cd826a8556b
2015-05-24 11:28:03 +00:00
jens dc0762a753 - removed unused port signals
git-svn-id: http://moon:8086/svn/vhdl/trunk@1205 cc03376c-175c-47c8-b038-4cd826a8556b
2015-05-24 11:16:04 +00:00
jens 670bad910d - fixed testbench
git-svn-id: http://moon:8086/svn/vhdl/trunk@1204 cc03376c-175c-47c8-b038-4cd826a8556b
2015-05-24 10:45:48 +00:00
jens 965590d383 - renamed config constants
git-svn-id: http://moon:8086/svn/vhdl/trunk@1203 cc03376c-175c-47c8-b038-4cd826a8556b
2015-05-24 10:44:20 +00:00
jens ddc3b8050e - renamed config constants
- added dedicated config for DDR mt46v16m16

git-svn-id: http://moon:8086/svn/vhdl/trunk@1202 cc03376c-175c-47c8-b038-4cd826a8556b
2015-05-24 10:39:18 +00:00
jens a0ad9a9182 - fixed mips_sys.vhd due to SDRAM changes
git-svn-id: http://moon:8086/svn/vhdl/trunk@1201 cc03376c-175c-47c8-b038-4cd826a8556b
2015-05-24 10:15:01 +00:00
jens b586cba1b0 - removed multi-source issue (Xilinx systhesis) for struct using in ports where individual elements are driven by different entities
- turned async. reset into sync. reset

git-svn-id: http://moon:8086/svn/vhdl/trunk@1200 cc03376c-175c-47c8-b038-4cd826a8556b
2015-05-24 10:11:56 +00:00
jens 4cd72abd34 - fixed mips_sys_sim.vhd due to SDRAM changes
git-svn-id: http://moon:8086/svn/vhdl/trunk@1199 cc03376c-175c-47c8-b038-4cd826a8556b
2015-05-24 09:58:56 +00:00
jens 3f4cbf0377 - renamed to wb64
git-svn-id: http://moon:8086/svn/vhdl/trunk@1198 cc03376c-175c-47c8-b038-4cd826a8556b
2015-05-24 09:32:23 +00:00
jens b828537c4d - sdram_ctrl_frontend_wb32.vhd.vhd implements J-Bus interface and exports abstract PHY interface
- ctrl_ddr_wb32 wraps sdram_ctrl_frontend_wb32 and adds specific PHY. This is now our new top level file

git-svn-id: http://moon:8086/svn/vhdl/trunk@1197 cc03376c-175c-47c8-b038-4cd826a8556b
2015-05-24 09:29:34 +00:00
jens 678f09b925 - renamed
git-svn-id: http://moon:8086/svn/vhdl/trunk@1196 cc03376c-175c-47c8-b038-4cd826a8556b
2015-05-24 09:23:10 +00:00
jens f06a5b3eb8 - fixed Zwischenstand
git-svn-id: http://moon:8086/svn/vhdl/trunk@1195 cc03376c-175c-47c8-b038-4cd826a8556b
2015-05-24 09:22:21 +00:00
jens 477467abaa - renamed
git-svn-id: http://moon:8086/svn/vhdl/trunk@1194 cc03376c-175c-47c8-b038-4cd826a8556b
2015-05-24 09:16:27 +00:00
jens a4395aba8a - fixed
git-svn-id: http://moon:8086/svn/vhdl/trunk@1193 cc03376c-175c-47c8-b038-4cd826a8556b
2015-05-24 09:10:18 +00:00
jens 75583b4cc4 - renamed
git-svn-id: http://moon:8086/svn/vhdl/trunk@1192 cc03376c-175c-47c8-b038-4cd826a8556b
2015-05-24 09:08:55 +00:00
jens a0525f2d6b - renamed
git-svn-id: http://moon:8086/svn/vhdl/trunk@1191 cc03376c-175c-47c8-b038-4cd826a8556b
2015-05-24 09:07:00 +00:00
jens f55028c696 - pulled PHY out of sdram_ctrl_top.vhd
- sdram_ctrl_frontend64_wb.vhd implements J-Bus interface and exports abstract PHY interface
- ctrl_ddr_wb64 wraps sdram_ctrl_frontend64_wb and adds specific PHY. This is now our new top level file

git-svn-id: http://moon:8086/svn/vhdl/trunk@1190 cc03376c-175c-47c8-b038-4cd826a8556b
2015-05-24 09:05:49 +00:00
jens ce636ef1ec - introduced phy_in_t and phy_out_t
git-svn-id: http://moon:8086/svn/vhdl/trunk@1189 cc03376c-175c-47c8-b038-4cd826a8556b
2015-05-24 08:15:35 +00:00
jens 88d51424b9 - cleaned up interfaces
- prepared for separating phy

git-svn-id: http://moon:8086/svn/vhdl/trunk@1188 cc03376c-175c-47c8-b038-4cd826a8556b
2015-05-24 07:28:22 +00:00
jens 4896105caf - deleted
git-svn-id: http://moon:8086/svn/vhdl/trunk@1187 cc03376c-175c-47c8-b038-4cd826a8556b
2015-05-24 06:05:24 +00:00
jens e18657267d - fixed path
git-svn-id: http://moon:8086/svn/vhdl/trunk@1186 cc03376c-175c-47c8-b038-4cd826a8556b
2015-05-23 16:18:15 +00:00
jens fc552de5b5 - added addional rom path from build folder
git-svn-id: http://moon:8086/svn/vhdl/trunk@1185 cc03376c-175c-47c8-b038-4cd826a8556b
2015-05-23 16:10:10 +00:00
jens f0c6196710 - fixed compile scripts
git-svn-id: http://moon:8086/svn/vhdl/trunk@1184 cc03376c-175c-47c8-b038-4cd826a8556b
2015-05-23 16:04:34 +00:00
jens 81b5e2f867 - added
git-svn-id: http://moon:8086/svn/vhdl/trunk@1183 cc03376c-175c-47c8-b038-4cd826a8556b
2015-05-23 15:37:00 +00:00
jens b9e398cd4b - deleted
git-svn-id: http://moon:8086/svn/vhdl/trunk@1182 cc03376c-175c-47c8-b038-4cd826a8556b
2015-05-23 15:34:14 +00:00
jens fea271f21e - deleted
git-svn-id: http://moon:8086/svn/vhdl/trunk@1181 cc03376c-175c-47c8-b038-4cd826a8556b
2015-05-23 15:30:35 +00:00
jens 9f42f0977e - cleaned up
git-svn-id: http://moon:8086/svn/vhdl/trunk@1180 cc03376c-175c-47c8-b038-4cd826a8556b
2015-05-23 13:28:33 +00:00
jens 2acd911f1a - cleaned up
- removed concurrent statement from process

git-svn-id: http://moon:8086/svn/vhdl/trunk@1179 cc03376c-175c-47c8-b038-4cd826a8556b
2015-05-23 11:42:43 +00:00
jens bcb0678984 - partially fixed DCM nightmare
git-svn-id: http://moon:8086/svn/vhdl/trunk@1178 cc03376c-175c-47c8-b038-4cd826a8556b
2015-05-23 11:32:09 +00:00
jens 811eb68146 Synthesis depends also on UCF
git-svn-id: http://moon:8086/svn/vhdl/trunk@1177 cc03376c-175c-47c8-b038-4cd826a8556b
2015-05-23 09:36:20 +00:00
jens 97de048b7f - fixed ucf
- cleaned up

git-svn-id: http://moon:8086/svn/vhdl/trunk@1176 cc03376c-175c-47c8-b038-4cd826a8556b
2015-05-23 09:34:16 +00:00
jens 1dc522c559 - keep clk0
git-svn-id: http://moon:8086/svn/vhdl/trunk@1175 cc03376c-175c-47c8-b038-4cd826a8556b
2015-05-23 09:33:27 +00:00
jens 3c0747a0a3 - fixed
git-svn-id: http://moon:8086/svn/vhdl/trunk@1174 cc03376c-175c-47c8-b038-4cd826a8556b
2015-05-23 08:58:36 +00:00
jens 17eb8faee1 - fixed mips_sys
git-svn-id: http://moon:8086/svn/vhdl/trunk@1173 cc03376c-175c-47c8-b038-4cd826a8556b
2015-05-23 08:56:24 +00:00
jens a08fda26f5 - updated boot loader
git-svn-id: http://moon:8086/svn/vhdl/trunk@1172 cc03376c-175c-47c8-b038-4cd826a8556b
2015-05-23 08:56:14 +00:00
jens 3ddbfdff33 - cleaned up
git-svn-id: http://moon:8086/svn/vhdl/trunk@1171 cc03376c-175c-47c8-b038-4cd826a8556b
2015-05-23 08:44:57 +00:00
jens b1dfffbc2a renamed clock entity
git-svn-id: http://moon:8086/svn/vhdl/trunk@1170 cc03376c-175c-47c8-b038-4cd826a8556b
2015-05-23 08:42:51 +00:00
jens c6323411e1 - added
git-svn-id: http://moon:8086/svn/vhdl/trunk@1169 cc03376c-175c-47c8-b038-4cd826a8556b
2015-05-23 08:35:44 +00:00
jens 55f1bfea82 - cleaned up
git-svn-id: http://moon:8086/svn/vhdl/trunk@1168 cc03376c-175c-47c8-b038-4cd826a8556b
2015-05-23 08:34:38 +00:00
jens 208c2a6eec - fixed
git-svn-id: http://moon:8086/svn/vhdl/trunk@1167 cc03376c-175c-47c8-b038-4cd826a8556b
2015-05-23 08:33:30 +00:00
jens 1dc80701fe - renamed
git-svn-id: http://moon:8086/svn/vhdl/trunk@1166 cc03376c-175c-47c8-b038-4cd826a8556b
2015-05-23 08:30:25 +00:00
jens 628593a879 - simplified clock stuff
git-svn-id: http://moon:8086/svn/vhdl/trunk@1165 cc03376c-175c-47c8-b038-4cd826a8556b
2015-05-23 08:30:01 +00:00
jens 752b788327 moved
git-svn-id: http://moon:8086/svn/vhdl/trunk@1164 cc03376c-175c-47c8-b038-4cd826a8556b
2015-05-23 08:18:37 +00:00
jens 910638fa11 moved
git-svn-id: http://moon:8086/svn/vhdl/trunk@1163 cc03376c-175c-47c8-b038-4cd826a8556b
2015-05-23 08:18:04 +00:00
jens f1db5927e2 - reverted: SRDY dependent on SDRAM_RST0
git-svn-id: http://moon:8086/svn/vhdl/trunk@1162 cc03376c-175c-47c8-b038-4cd826a8556b
2015-05-23 08:05:31 +00:00
jens 0d68ca00ac - working (SDRAM head)
- use hello_sim for test bench
- changed sys clock gen

git-svn-id: http://moon:8086/svn/vhdl/trunk@1161 cc03376c-175c-47c8-b038-4cd826a8556b
2015-05-23 08:02:23 +00:00
jens 7668dd7814 - fixed delta delay. clk0 is generated and evaluated ddr_phy_virtex4 in simulation step n.
Entities using clk0_out are evaluated in simulation step n+1, causing data sampling during data change.

git-svn-id: http://moon:8086/svn/vhdl/trunk@1160 cc03376c-175c-47c8-b038-4cd826a8556b
2015-05-23 07:38:25 +00:00
jens 38593077e9 - changed props
git-svn-id: http://moon:8086/svn/vhdl/trunk@1159 cc03376c-175c-47c8-b038-4cd826a8556b
2015-05-23 05:25:32 +00:00
jens 47b93c6228 - ignore
git-svn-id: http://moon:8086/svn/vhdl/trunk@1158 cc03376c-175c-47c8-b038-4cd826a8556b
2015-05-23 05:24:45 +00:00
jens 22152cee0f - use old bootloader and run dhrystone
git-svn-id: http://moon:8086/svn/vhdl/trunk@1157 cc03376c-175c-47c8-b038-4cd826a8556b
2015-05-22 22:10:13 +00:00
jens 7c1cc7980b - working (SDRAM R1153)
git-svn-id: http://moon:8086/svn/vhdl/trunk@1156 cc03376c-175c-47c8-b038-4cd826a8556b
2015-05-22 21:53:31 +00:00
jens dfffc2ffc7 - SRDY dependent on SDRAM_RST0
git-svn-id: http://moon:8086/svn/vhdl/trunk@1155 cc03376c-175c-47c8-b038-4cd826a8556b
2015-05-22 19:47:38 +00:00
jens be1bae5243 - added reset out
git-svn-id: http://moon:8086/svn/vhdl/trunk@1154 cc03376c-175c-47c8-b038-4cd826a8556b
2015-05-22 19:35:46 +00:00
jens 94665d9c19 [SDRAM-Controller]
- refactored: moved clockgen into phy
- removed async resets

git-svn-id: http://moon:8086/svn/vhdl/trunk@1153 cc03376c-175c-47c8-b038-4cd826a8556b
2015-05-22 17:49:58 +00:00
jens ba98d8e13e - added SDRAM model
git-svn-id: http://moon:8086/svn/vhdl/trunk@1152 cc03376c-175c-47c8-b038-4cd826a8556b
2015-05-22 06:16:03 +00:00
jens 62499069a2 - fixed type cast in test bench
git-svn-id: http://moon:8086/svn/vhdl/trunk@1151 cc03376c-175c-47c8-b038-4cd826a8556b
2015-05-22 06:14:32 +00:00
jens 1d6bd6979a - pull bootloader from mips software build
git-svn-id: http://moon:8086/svn/vhdl/trunk@1150 cc03376c-175c-47c8-b038-4cd826a8556b
2015-05-22 06:03:51 +00:00
jens 7314433047 - no extra effort
git-svn-id: http://moon:8086/svn/vhdl/trunk@1149 cc03376c-175c-47c8-b038-4cd826a8556b
2015-05-21 19:19:30 +00:00
jens 0dec1e970c - use 16k I/D-Cache
git-svn-id: http://moon:8086/svn/vhdl/trunk@1148 cc03376c-175c-47c8-b038-4cd826a8556b
2015-05-21 18:43:48 +00:00
jens b941473d61 - use default mapping and par settings
git-svn-id: http://moon:8086/svn/vhdl/trunk@1147 cc03376c-175c-47c8-b038-4cd826a8556b
2015-05-21 18:42:56 +00:00
jens a342eac188 - use area GOOD 3
git-svn-id: http://moon:8086/svn/vhdl/trunk@1146 cc03376c-175c-47c8-b038-4cd826a8556b
2015-05-21 18:34:47 +00:00
jens 31de77081c Fixed
git-svn-id: http://moon:8086/svn/vhdl/trunk@1145 cc03376c-175c-47c8-b038-4cd826a8556b
2015-05-21 18:12:33 +00:00
jens 943a081c61 - fixed
git-svn-id: http://moon:8086/svn/vhdl/trunk@1144 cc03376c-175c-47c8-b038-4cd826a8556b
2015-05-21 17:58:43 +00:00
jens 08e0105ab2 - deleted
git-svn-id: http://moon:8086/svn/vhdl/trunk@1143 cc03376c-175c-47c8-b038-4cd826a8556b
2015-05-21 17:53:07 +00:00
jens 016c84ee80 - fixed
git-svn-id: http://moon:8086/svn/vhdl/trunk@1142 cc03376c-175c-47c8-b038-4cd826a8556b
2015-05-21 17:52:39 +00:00
jens ac38fe2513 Moved
git-svn-id: http://moon:8086/svn/vhdl/trunk@1141 cc03376c-175c-47c8-b038-4cd826a8556b
2015-05-21 17:49:48 +00:00
jens 2e66c57e0c - moved synthesis relevant files to project
git-svn-id: http://moon:8086/svn/vhdl/trunk@1140 cc03376c-175c-47c8-b038-4cd826a8556b
2015-05-21 06:48:46 +00:00
jens 0bbc4aeb6c - deleted
git-svn-id: http://moon:8086/svn/vhdl/trunk@1139 cc03376c-175c-47c8-b038-4cd826a8556b
2015-05-21 06:43:20 +00:00
jens a7f2f3e5bb Moved
git-svn-id: http://moon:8086/svn/vhdl/trunk@1138 cc03376c-175c-47c8-b038-4cd826a8556b
2015-05-21 06:41:43 +00:00
jens 6a6e02a46b - added
git-svn-id: http://moon:8086/svn/vhdl/trunk@1137 cc03376c-175c-47c8-b038-4cd826a8556b
2015-05-21 06:39:25 +00:00
jens a830a1e650 - fixed bitgen
git-svn-id: http://moon:8086/svn/vhdl/trunk@1136 cc03376c-175c-47c8-b038-4cd826a8556b
2015-05-20 23:22:50 +00:00
jens b4e40f2045 - fixed targets
git-svn-id: http://moon:8086/svn/vhdl/trunk@1135 cc03376c-175c-47c8-b038-4cd826a8556b
2015-05-20 23:07:20 +00:00
jens 35ff958aec - no copy
git-svn-id: http://moon:8086/svn/vhdl/trunk@1134 cc03376c-175c-47c8-b038-4cd826a8556b
2015-05-20 22:48:37 +00:00
jens 97c90054da - added
git-svn-id: http://moon:8086/svn/vhdl/trunk@1133 cc03376c-175c-47c8-b038-4cd826a8556b
2015-05-20 22:47:16 +00:00
jens 38bd9acd52 -deleted
git-svn-id: http://moon:8086/svn/vhdl/trunk@1132 cc03376c-175c-47c8-b038-4cd826a8556b
2015-05-20 22:31:46 +00:00
jens 1423984428 -deleted
git-svn-id: http://moon:8086/svn/vhdl/trunk@1131 cc03376c-175c-47c8-b038-4cd826a8556b
2015-05-20 22:31:20 +00:00
jens 4b9cba542b - deleted
git-svn-id: http://moon:8086/svn/vhdl/trunk@1130 cc03376c-175c-47c8-b038-4cd826a8556b
2015-05-20 21:55:12 +00:00
jens 7f780a37a5 - added mips_sys full flow
git-svn-id: http://moon:8086/svn/vhdl/trunk@1129 cc03376c-175c-47c8-b038-4cd826a8556b
2015-05-20 21:54:44 +00:00
jens d8c54b3aaf - added
git-svn-id: http://moon:8086/svn/vhdl/trunk@1128 cc03376c-175c-47c8-b038-4cd826a8556b
2015-05-20 20:38:43 +00:00
jens 0a8974c7cd - added
git-svn-id: http://moon:8086/svn/vhdl/trunk@1127 cc03376c-175c-47c8-b038-4cd826a8556b
2015-05-20 20:30:34 +00:00
jens 6034b51816 - fixed
git-svn-id: http://moon:8086/svn/vhdl/trunk@1126 cc03376c-175c-47c8-b038-4cd826a8556b
2015-05-20 20:30:02 +00:00
jens 136ce46020 - fixed
git-svn-id: http://moon:8086/svn/vhdl/trunk@1125 cc03376c-175c-47c8-b038-4cd826a8556b
2015-05-20 20:29:40 +00:00
jens 72ccf2c243 - deleted
git-svn-id: http://moon:8086/svn/vhdl/trunk@1124 cc03376c-175c-47c8-b038-4cd826a8556b
2015-05-20 20:12:14 +00:00
jens 4ee703f9b4 - added Makefile
- fixed xst-file

git-svn-id: http://moon:8086/svn/vhdl/trunk@1123 cc03376c-175c-47c8-b038-4cd826a8556b
2015-05-20 20:11:54 +00:00
jens d0e55bb674 - added
git-svn-id: http://moon:8086/svn/vhdl/trunk@1122 cc03376c-175c-47c8-b038-4cd826a8556b
2015-05-20 19:58:21 +00:00
jens bcc7de6fd6 - added
git-svn-id: http://moon:8086/svn/vhdl/trunk@1121 cc03376c-175c-47c8-b038-4cd826a8556b
2015-05-20 19:52:44 +00:00
jens 153f59cda7 - added unisim sources
git-svn-id: http://moon:8086/svn/vhdl/trunk@1120 cc03376c-175c-47c8-b038-4cd826a8556b
2015-05-20 05:48:08 +00:00
jens 06f158ac3e - updated after re-creation of ISE project
git-svn-id: http://moon:8086/svn/vhdl/trunk@1119 cc03376c-175c-47c8-b038-4cd826a8556b
2015-05-19 05:42:59 +00:00
jens 69a2ee32a1 [VGA]
- fixes due to dpram changes


git-svn-id: http://moon:8086/svn/vhdl/trunk@1118 cc03376c-175c-47c8-b038-4cd826a8556b
2015-05-17 19:10:49 +00:00
jens 06d9c0115c - delete work at startup
git-svn-id: http://moon:8086/svn/vhdl/trunk@1117 cc03376c-175c-47c8-b038-4cd826a8556b
2015-05-17 19:05:46 +00:00
jens bfb58f3b4e [SDRAM]
- changes due to FIFO changes

git-svn-id: http://moon:8086/svn/vhdl/trunk@1116 cc03376c-175c-47c8-b038-4cd826a8556b
2015-05-17 19:02:36 +00:00
jens e691b4429b [EMAC]
- fixes due to dpram changes
- testbench has less delay

git-svn-id: http://moon:8086/svn/vhdl/trunk@1115 cc03376c-175c-47c8-b038-4cd826a8556b
2015-05-17 18:56:21 +00:00
jens bd3aa8c06e [Xilinx/dpram_2w2r2c_ra]
- re_a, re_b don't care

git-svn-id: http://moon:8086/svn/vhdl/trunk@1114 cc03376c-175c-47c8-b038-4cd826a8556b
2015-05-17 18:14:42 +00:00
jens bafe1745c5 [ICache]
- tag_ram_re don't care

git-svn-id: http://moon:8086/svn/vhdl/trunk@1113 cc03376c-175c-47c8-b038-4cd826a8556b
2015-05-17 18:12:03 +00:00
jens 40ce9c1d94 - fixed packages
git-svn-id: http://moon:8086/svn/vhdl/trunk@1112 cc03376c-175c-47c8-b038-4cd826a8556b
2015-05-17 18:02:33 +00:00
jens 228e893904 - interface change to rams
git-svn-id: http://moon:8086/svn/vhdl/trunk@1111 cc03376c-175c-47c8-b038-4cd826a8556b
2015-05-17 17:24:05 +00:00
jens 5e38a6ff43 - ram_sim.vhd deleted
- ram_wb has it's own ram implementation

git-svn-id: http://moon:8086/svn/vhdl/trunk@1110 cc03376c-175c-47c8-b038-4cd826a8556b
2015-05-17 11:21:17 +00:00
jens 0d992f0999 - fixed WE_I
git-svn-id: http://moon:8086/svn/vhdl/trunk@1109 cc03376c-175c-47c8-b038-4cd826a8556b
2015-05-17 11:20:57 +00:00
jens 9cbdedff8e - added single clock variant
git-svn-id: http://moon:8086/svn/vhdl/trunk@1108 cc03376c-175c-47c8-b038-4cd826a8556b
2015-05-17 11:19:06 +00:00
jens 9c0bdbd6be - ram_sim.vhd deleted
- ram_wb has it's own ram implementation

git-svn-id: http://moon:8086/svn/vhdl/trunk@1107 cc03376c-175c-47c8-b038-4cd826a8556b
2015-05-17 11:15:59 +00:00
jens eaec09fd09 - reverted to clk2
git-svn-id: http://moon:8086/svn/vhdl/trunk@1106 cc03376c-175c-47c8-b038-4cd826a8556b
2015-05-17 10:33:43 +00:00
jens 9453e9b1aa - delete work at startup
git-svn-id: http://moon:8086/svn/vhdl/trunk@1105 cc03376c-175c-47c8-b038-4cd826a8556b
2015-05-17 07:25:31 +00:00
jens dfca80c273 - smaller default depth
git-svn-id: http://moon:8086/svn/vhdl/trunk@1104 cc03376c-175c-47c8-b038-4cd826a8556b
2015-05-17 07:17:58 +00:00
jens 92b39b9539 - delete work
git-svn-id: http://moon:8086/svn/vhdl/trunk@1103 cc03376c-175c-47c8-b038-4cd826a8556b
2015-05-17 06:15:15 +00:00
jens 0f70052aa3 - delete work at startup
git-svn-id: http://moon:8086/svn/vhdl/trunk@1102 cc03376c-175c-47c8-b038-4cd826a8556b
2015-05-16 21:19:18 +00:00
jens 7705d1220e - added libs
git-svn-id: http://moon:8086/svn/vhdl/trunk@1101 cc03376c-175c-47c8-b038-4cd826a8556b
2015-05-16 19:17:38 +00:00
jens 7ac9bde7ff - fixed redundant sources
git-svn-id: http://moon:8086/svn/vhdl/trunk@1100 cc03376c-175c-47c8-b038-4cd826a8556b
2015-05-16 19:13:05 +00:00
jens 1237143a38 - updated
git-svn-id: http://moon:8086/svn/vhdl/trunk@1099 cc03376c-175c-47c8-b038-4cd826a8556b
2015-05-16 18:19:47 +00:00
jens fd682df811 - added
git-svn-id: http://moon:8086/svn/vhdl/trunk@1098 cc03376c-175c-47c8-b038-4cd826a8556b
2015-05-16 17:52:06 +00:00
jens 0afb7b1758 - added
git-svn-id: http://moon:8086/svn/vhdl/trunk@1097 cc03376c-175c-47c8-b038-4cd826a8556b
2015-05-16 17:41:08 +00:00
jens f6e00c3922 git-svn-id: http://moon:8086/svn/vhdl/trunk@1096 cc03376c-175c-47c8-b038-4cd826a8556b 2015-05-16 17:40:43 +00:00
jens e919e0028e - added
git-svn-id: http://moon:8086/svn/vhdl/trunk@1095 cc03376c-175c-47c8-b038-4cd826a8556b
2015-05-16 17:25:11 +00:00
jens f541f84db1 - cleaned up NOPs
git-svn-id: http://moon:8086/svn/vhdl/trunk@1094 cc03376c-175c-47c8-b038-4cd826a8556b
2015-05-16 17:16:22 +00:00
jens 4e66c8c1c8 - better reset values for pipe regs
- WB_stall is stall_all. More WB signal are stalled, may have functional impact or not

git-svn-id: http://moon:8086/svn/vhdl/trunk@1093 cc03376c-175c-47c8-b038-4cd826a8556b
2015-05-16 17:02:11 +00:00
jens 02e2f89308 - renamed signals
git-svn-id: http://moon:8086/svn/vhdl/trunk@1092 cc03376c-175c-47c8-b038-4cd826a8556b
2015-05-16 16:53:19 +00:00
jens d282feb11d - fixed missing signal
git-svn-id: http://moon:8086/svn/vhdl/trunk@1091 cc03376c-175c-47c8-b038-4cd826a8556b
2015-05-16 15:06:18 +00:00
jens deefbcffb3 - reworked FIFOs
- use synchronous resets

git-svn-id: http://moon:8086/svn/vhdl/trunk@1090 cc03376c-175c-47c8-b038-4cd826a8556b
2015-05-16 15:05:04 +00:00
jens bbd2673d42 - fixed
git-svn-id: http://moon:8086/svn/vhdl/trunk@1089 cc03376c-175c-47c8-b038-4cd826a8556b
2015-05-15 19:22:24 +00:00
jens 833c2cfd5d - del
git-svn-id: http://moon:8086/svn/vhdl/trunk@1088 cc03376c-175c-47c8-b038-4cd826a8556b
2015-05-15 18:56:52 +00:00
jens 0cd6e321f1 - use bootloader_flash
git-svn-id: http://moon:8086/svn/vhdl/trunk@1087 cc03376c-175c-47c8-b038-4cd826a8556b
2015-05-15 18:55:36 +00:00
jens fde16498ad - added
git-svn-id: http://moon:8086/svn/vhdl/trunk@1086 cc03376c-175c-47c8-b038-4cd826a8556b
2015-05-15 18:54:55 +00:00
jens 19183aabc8 - del
git-svn-id: http://moon:8086/svn/vhdl/trunk@1085 cc03376c-175c-47c8-b038-4cd826a8556b
2015-05-15 18:53:24 +00:00
jens 691706ef57 - cleaned up unused signals
- fixed sensitivity list issues

git-svn-id: http://moon:8086/svn/vhdl/trunk@1084 cc03376c-175c-47c8-b038-4cd826a8556b
2015-05-15 16:36:33 +00:00
jens 182e68126e - use dpram_xxx_ra for synthesis
- fixed do file for post synthesis simulation


git-svn-id: http://moon:8086/svn/vhdl/trunk@1083 cc03376c-175c-47c8-b038-4cd826a8556b
2015-05-14 20:45:05 +00:00
jens 5c6c1fd1cd - added
git-svn-id: http://moon:8086/svn/vhdl/trunk@1082 cc03376c-175c-47c8-b038-4cd826a8556b
2015-05-14 16:14:15 +00:00
jens b06aab0b3c [MIPS]
- removed propagation delays from core source
- default 1kWord I/D-Cache

git-svn-id: http://moon:8086/svn/vhdl/trunk@1081 cc03376c-175c-47c8-b038-4cd826a8556b
2015-05-14 16:13:08 +00:00
jens ff20480866 [TB]
- use correct hello.elf.flash.bin

git-svn-id: http://moon:8086/svn/vhdl/trunk@1080 cc03376c-175c-47c8-b038-4cd826a8556b
2015-05-14 11:00:20 +00:00
jens db9e21023c [uart]
- added simulation entities

git-svn-id: http://moon:8086/svn/vhdl/trunk@1079 cc03376c-175c-47c8-b038-4cd826a8556b
2015-05-14 10:59:18 +00:00
jens 4cd6758a4b [FIFO]
- use RAMs with registered address

git-svn-id: http://moon:8086/svn/vhdl/trunk@1078 cc03376c-175c-47c8-b038-4cd826a8556b
2015-05-14 10:58:19 +00:00
jens fe322f0f58 - added
git-svn-id: http://moon:8086/svn/vhdl/trunk@1077 cc03376c-175c-47c8-b038-4cd826a8556b
2015-05-14 10:54:29 +00:00
jens 7649454e46 - no change, only touched
git-svn-id: http://moon:8086/svn/vhdl/trunk@1076 cc03376c-175c-47c8-b038-4cd826a8556b
2015-02-07 08:04:55 +00:00
jens 2d7ca921d4 [tb_mips_top]
- hello working

git-svn-id: http://moon:8086/svn/vhdl/trunk@1075 cc03376c-175c-47c8-b038-4cd826a8556b
2015-02-07 08:00:29 +00:00
jens 07967f5009 - added dist
git-svn-id: http://moon:8086/svn/vhdl/trunk@1074 cc03376c-175c-47c8-b038-4cd826a8556b
2015-02-07 06:38:44 +00:00
jens e17a1eefb5 - initial version
git-svn-id: http://moon:8086/svn/vhdl/trunk@1073 cc03376c-175c-47c8-b038-4cd826a8556b
2015-02-07 06:35:28 +00:00
jens 7139c44dba - deleted
git-svn-id: http://moon:8086/svn/vhdl/trunk@1072 cc03376c-175c-47c8-b038-4cd826a8556b
2014-07-25 06:47:31 +00:00
jens c3def58a86 - added
git-svn-id: http://moon:8086/svn/vhdl/trunk@1071 cc03376c-175c-47c8-b038-4cd826a8556b
2014-07-25 06:46:58 +00:00
jens 49d461b30c - added
git-svn-id: http://moon:8086/svn/vhdl/trunk@1070 cc03376c-175c-47c8-b038-4cd826a8556b
2014-07-25 06:37:47 +00:00
jens 37ccf88d01 - renamed (CVS didn't rename it)
- added

git-svn-id: http://moon:8086/svn/vhdl/trunk@1069 cc03376c-175c-47c8-b038-4cd826a8556b
2014-07-25 06:34:11 +00:00
jens b6ba2e0ceb - added
- simulation clean

git-svn-id: http://moon:8086/svn/vhdl/trunk@1068 cc03376c-175c-47c8-b038-4cd826a8556b
2014-07-24 06:47:53 +00:00
jens 01b998de21 - added
- simulation clean

git-svn-id: http://moon:8086/svn/vhdl/trunk@1067 cc03376c-175c-47c8-b038-4cd826a8556b
2014-07-24 06:46:07 +00:00
jens aeac0c85ad - simulation clean
git-svn-id: http://moon:8086/svn/vhdl/trunk@1066 cc03376c-175c-47c8-b038-4cd826a8556b
2014-07-24 06:42:19 +00:00
jens c02d1c0bbb - added
git-svn-id: http://moon:8086/svn/vhdl/trunk@1065 cc03376c-175c-47c8-b038-4cd826a8556b
2014-07-24 06:33:46 +00:00
jens 714cf9990b - added
git-svn-id: http://moon:8086/svn/vhdl/trunk@1064 cc03376c-175c-47c8-b038-4cd826a8556b
2014-07-24 06:31:44 +00:00
jens 40585be161 CRLF
git-svn-id: http://moon:8086/svn/vhdl/trunk@1063 cc03376c-175c-47c8-b038-4cd826a8556b
2014-07-24 06:29:33 +00:00
jens e4ee71e3aa - simulation clean
git-svn-id: http://moon:8086/svn/vhdl/trunk@1062 cc03376c-175c-47c8-b038-4cd826a8556b
2014-07-24 06:28:38 +00:00
jens a524cfd8a5 git-svn-id: http://moon:8086/svn/vhdl/trunk@1061 cc03376c-175c-47c8-b038-4cd826a8556b 2014-07-23 20:37:29 +00:00
jens e5ac777d1f - added
git-svn-id: http://moon:8086/svn/vhdl/trunk@1060 cc03376c-175c-47c8-b038-4cd826a8556b
2014-07-23 20:36:53 +00:00
jens 6752df9a9e - added
git-svn-id: http://moon:8086/svn/vhdl/trunk@1059 cc03376c-175c-47c8-b038-4cd826a8556b
2014-07-23 20:35:25 +00:00
jens c5ee4b9f8e - added
git-svn-id: http://moon:8086/svn/vhdl/trunk@1058 cc03376c-175c-47c8-b038-4cd826a8556b
2014-07-23 20:34:41 +00:00
jens 0c9665f21c - use %VHDL_HOME%\
git-svn-id: http://moon:8086/svn/vhdl/trunk@1057 cc03376c-175c-47c8-b038-4cd826a8556b
2014-07-23 20:34:10 +00:00
jens 4eff4f531e - moved real_array_t and natural_array_t
git-svn-id: http://moon:8086/svn/vhdl/trunk@1056 cc03376c-175c-47c8-b038-4cd826a8556b
2014-07-23 20:30:42 +00:00
jens 8a1836039c - added
git-svn-id: http://moon:8086/svn/vhdl/trunk@1055 cc03376c-175c-47c8-b038-4cd826a8556b
2014-07-23 20:14:55 +00:00
jens b754491070 - added
git-svn-id: http://moon:8086/svn/vhdl/trunk@1054 cc03376c-175c-47c8-b038-4cd826a8556b
2014-07-23 20:14:34 +00:00
jens 322468adb9 - added
git-svn-id: http://moon:8086/svn/vhdl/trunk@1053 cc03376c-175c-47c8-b038-4cd826a8556b
2014-07-23 20:13:44 +00:00
jens f585adb8b7 - added
- CRLF

git-svn-id: http://moon:8086/svn/vhdl/trunk@1052 cc03376c-175c-47c8-b038-4cd826a8556b
2014-07-23 20:13:06 +00:00
jens 32d9c79467 - added
git-svn-id: http://moon:8086/svn/vhdl/trunk@1051 cc03376c-175c-47c8-b038-4cd826a8556b
2014-07-23 20:12:08 +00:00
jens 30184e5502 CRLF
git-svn-id: http://moon:8086/svn/vhdl/trunk@1050 cc03376c-175c-47c8-b038-4cd826a8556b
2014-07-23 20:11:52 +00:00
jens 52acc7bd34 CRLF
git-svn-id: http://moon:8086/svn/vhdl/trunk@1049 cc03376c-175c-47c8-b038-4cd826a8556b
2014-07-23 20:10:34 +00:00
jens 4430b4eb37 CRLF
git-svn-id: http://moon:8086/svn/vhdl/trunk@1048 cc03376c-175c-47c8-b038-4cd826a8556b
2014-07-23 20:08:46 +00:00
jens 87298253d2 CRLF
git-svn-id: http://moon:8086/svn/vhdl/trunk@1047 cc03376c-175c-47c8-b038-4cd826a8556b
2014-07-23 20:08:11 +00:00
jens 0c41791956 CRLF
git-svn-id: http://moon:8086/svn/vhdl/trunk@1046 cc03376c-175c-47c8-b038-4cd826a8556b
2014-07-23 20:07:32 +00:00
jens 1898185020 git-svn-id: http://moon:8086/svn/vhdl/trunk@1045 cc03376c-175c-47c8-b038-4cd826a8556b 2014-07-23 20:06:45 +00:00
jens 57c876c27a - unversion
git-svn-id: http://moon:8086/svn/vhdl/trunk@1044 cc03376c-175c-47c8-b038-4cd826a8556b
2014-07-23 20:06:08 +00:00
jens 356308b4ea git-svn-id: http://moon:8086/svn/vhdl/trunk@1043 cc03376c-175c-47c8-b038-4cd826a8556b 2014-07-23 20:05:09 +00:00
jens 1a80a502d3 - unversion
git-svn-id: http://moon:8086/svn/vhdl/trunk@1042 cc03376c-175c-47c8-b038-4cd826a8556b
2014-07-23 20:04:26 +00:00
jens b400f0a1a7 - added
git-svn-id: http://moon:8086/svn/vhdl/trunk@1041 cc03376c-175c-47c8-b038-4cd826a8556b
2014-07-23 20:03:52 +00:00
jens b26c0b526c - renamed (CVS didn't rename it)
git-svn-id: http://moon:8086/svn/vhdl/trunk@1040 cc03376c-175c-47c8-b038-4cd826a8556b
2014-07-23 20:00:33 +00:00
jens 6246a78478 - added
git-svn-id: http://moon:8086/svn/vhdl/trunk@1039 cc03376c-175c-47c8-b038-4cd826a8556b
2014-07-23 19:58:05 +00:00
jens edb60cf6cd - renamed (CVS didn't rename it)
git-svn-id: http://moon:8086/svn/vhdl/trunk@1038 cc03376c-175c-47c8-b038-4cd826a8556b
2014-07-23 19:56:47 +00:00
jens b85b41e65d - reverted debug back to unsigned
git-svn-id: http://moon:8086/svn/vhdl/trunk@1037 cc03376c-175c-47c8-b038-4cd826a8556b
2014-07-23 19:56:08 +00:00
jens 70e48af3ab - commit local changes after CVS2SVN
git-svn-id: http://moon:8086/svn/vhdl/trunk@1036 cc03376c-175c-47c8-b038-4cd826a8556b
2014-07-20 13:30:14 +00:00
jens 175cf3a4f4 - put pkt_re outside of 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@1033 cc03376c-175c-47c8-b038-4cd826a8556b
2013-09-22 10:43:17 +00:00
jens b4a8815af3 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@1031 cc03376c-175c-47c8-b038-4cd826a8556b
2013-08-31 15:42:23 +00:00
jens b12bb21d64 - added timing constraints
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@1021 cc03376c-175c-47c8-b038-4cd826a8556b
2013-08-24 16:34:44 +00:00
jens f81cd4018f - debug output reverted to unsigned vector
-> (record doesnt work for netlist 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@1020 cc03376c-175c-47c8-b038-4cd826a8556b
2013-08-24 11:44:56 +00:00
jens 11c9696320 - 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@1006 cc03376c-175c-47c8-b038-4cd826a8556b
2013-08-18 08:15:41 +00:00
jens f3f42c7c14 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@1005 cc03376c-175c-47c8-b038-4cd826a8556b
2013-08-18 08:09:26 +00:00
jens 242631375f Branch entry:
- use mapped addresses
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@1004 cc03376c-175c-47c8-b038-4cd826a8556b
2013-08-18 08:06:06 +00:00
1747 changed files with 1225879 additions and 72565 deletions
Binary file not shown.
@@ -0,0 +1,4 @@
PACKAGE ALT_CUSP_PACKAGE IS
END ALT_CUSP_PACKAGE;
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,689 @@
-- Copyright (C) 1991-2015 Altera Corporation. All rights reserved.
-- Your use of Altera Corporation's design tools, logic functions
-- and other software and tools, and its AMPP partner logic
-- functions, and any output files from any of the foregoing
-- (including device programming or simulation files), and any
-- associated documentation or information are expressly subject
-- to the terms and conditions of the Altera Program License
-- Subscription Agreement, the Altera Quartus II License Agreement,
-- the Altera MegaCore Function License Agreement, or other
-- applicable license agreement, including, without limitation,
-- that your use is for the sole purpose of programming logic
-- devices manufactured by Altera and sold by Altera or its
-- authorized distributors. Please refer to the applicable
-- agreement for further details.
-----------------------------------------------------------------------------
-- --
-- Description: Declares utility package for Altera IP support --
-- --
-- --
-- *** USER DESIGNS SHOULD NOT INCLUDE THIS PACKAGE DIRECTLY *** --
-- --
------------------------------------------------------------------------------
-- ----------------------------------------------------------------------------
--
-- These routines are used to help SOPC Builder generate VHDL code.
--
-- ----------------------------------------------------------------------------
library IEEE;
use IEEE.STD_LOGIC_1164.all;
use IEEE.NUMERIC_STD.all;
use IEEE.STD_LOGIC_UNSIGNED.all;
package altera_europa_support_lib is
attribute IS_SIGNED : BOOLEAN ;
attribute SYNTHESIS_RETURN : STRING ;
FUNCTION and_reduce(arg : STD_LOGIC_VECTOR) RETURN STD_LOGIC;
-- Result subtype: STD_LOGIC.
-- Result: Result of and'ing all of the bits of the vector.
FUNCTION nand_reduce(arg : STD_LOGIC_VECTOR) RETURN STD_LOGIC;
-- Result subtype: STD_LOGIC.
-- Result: Result of nand'ing all of the bits of the vector.
FUNCTION or_reduce(arg : STD_LOGIC_VECTOR) RETURN STD_LOGIC;
-- Result subtype: STD_LOGIC.
-- Result: Result of or'ing all of the bits of the vector.
FUNCTION nor_reduce(arg : STD_LOGIC_VECTOR) RETURN STD_LOGIC;
-- Result subtype: STD_LOGIC.
-- Result: Result of nor'ing all of the bits of the vector.
FUNCTION xor_reduce(arg : STD_LOGIC_VECTOR) RETURN STD_LOGIC;
-- Result subtype: STD_LOGIC.
-- Result: Result of xor'ing all of the bits of the vector.
FUNCTION xnor_reduce(arg : STD_LOGIC_VECTOR) RETURN STD_LOGIC;
-- Result subtype: STD_LOGIC.
-- Result: Result of xnor'ing all of the bits of the vector.
FUNCTION A_SRL(arg: std_logic_vector; shift: integer) RETURN std_logic_vector;
FUNCTION A_SLL(arg: std_logic_vector; shift: integer) RETURN std_logic_vector;
FUNCTION A_SRL(arg: std_logic_vector; shift: std_logic_vector) RETURN std_logic_vector;
FUNCTION A_SLL(arg: std_logic_vector; shift: std_logic_vector) RETURN std_logic_vector;
FUNCTION A_TOSTDLOGICVECTOR(a: std_logic) RETURN std_logic_vector;
FUNCTION A_TOSTDLOGICVECTOR(a: std_logic_vector) RETURN std_logic_vector;
FUNCTION A_WE_StdLogic (select_arg: boolean; then_arg: STD_LOGIC ; else_arg:STD_LOGIC) RETURN STD_LOGIC;
FUNCTION A_WE_StdUlogic (select_arg: boolean; then_arg: STD_ULOGIC; else_arg:STD_ULOGIC) RETURN STD_ULOGIC;
FUNCTION A_WE_StdLogicVector(select_arg: boolean; then_arg: STD_LOGIC_VECTOR; else_arg:STD_LOGIC_VECTOR) RETURN STD_LOGIC_VECTOR;
FUNCTION A_WE_StdUlogicVector(select_arg: boolean; then_arg: STD_ULOGIC_VECTOR; else_arg:STD_ULOGIC_VECTOR) RETURN STD_ULOGIC_VECTOR;
FUNCTION Vector_To_Std_Logic(vector: STD_LOGIC_VECTOR) return Std_Logic;
function TO_STD_LOGIC(arg : BOOLEAN) return STD_LOGIC;
-- Result subtype: STD_LOGIC
-- Result: Converts a BOOLEAN to a STD_LOGIC..
FUNCTION a_rep(arg : STD_LOGIC; repeat : INTEGER) RETURN STD_LOGIC_VECTOR ;
FUNCTION a_rep_vector(arg : STD_LOGIC_VECTOR; repeat : INTEGER) RETURN STD_LOGIC_VECTOR ;
function a_min(L, R: INTEGER) return INTEGER ;
function a_max(L, R: INTEGER) return INTEGER ;
FUNCTION a_ext (arg : STD_LOGIC_VECTOR; size : INTEGER) RETURN STD_LOGIC_VECTOR ;
-------------------------------------------------------
-- Conversions for Verilog $display/$write emulation --
-------------------------------------------------------
-- All required padding is to the left of the value (right justified) to
-- a string that can hold the maximum value of the vector in that radix.
-- When displaying decimal values (e.g. %d), padding is spaces.
-- When displaying other radices (e.g. %h), padding is zeros.
-- There is no padding when a zero is placed after the % (e.g. %0d or %0h).
type pad_type is (pad_none, pad_spaces, pad_zeros);
function to_hex_string(val : std_logic_vector;
pad : pad_type := pad_zeros) return string;
function to_decimal_string(val : integer;
pad : pad_type := pad_spaces) return string;
function to_decimal_string(val : std_logic_vector;
pad : pad_type := pad_spaces) return string;
function to_octal_string(val : std_logic_vector;
pad : pad_type := pad_zeros) return string;
function to_binary_string(val : std_logic_vector;
pad : pad_type := pad_zeros) return string;
function to_hex_string(val : std_logic;
pad : pad_type := pad_zeros) return string;
function to_decimal_string(val : std_logic;
pad : pad_type := pad_spaces) return string;
function to_octal_string(val : std_logic;
pad : pad_type := pad_zeros) return string;
function to_binary_string(val : std_logic;
pad : pad_type := pad_zeros) return string;
end altera_europa_support_lib;
package body altera_europa_support_lib is
--
-- Reducing logical functions.
--
FUNCTION and_reduce(arg: STD_LOGIC_VECTOR) RETURN STD_LOGIC IS
VARIABLE result: STD_LOGIC;
-- Exemplar synthesis directive attributes for this function
ATTRIBUTE synthesis_RETURN OF result:VARIABLE IS "REDUCE_AND" ;
BEGIN
result := '1';
FOR i IN arg'RANGE LOOP
result := result AND arg(i);
END LOOP;
RETURN result;
END;
FUNCTION nand_reduce(arg: STD_LOGIC_VECTOR) RETURN STD_LOGIC IS
VARIABLE result: STD_LOGIC;
ATTRIBUTE synthesis_RETURN OF result:VARIABLE IS "REDUCE_NAND" ;
BEGIN
result := NOT and_reduce(arg);
RETURN result;
END;
FUNCTION or_reduce(arg: STD_LOGIC_VECTOR) RETURN STD_LOGIC IS
VARIABLE result: STD_LOGIC;
-- Exemplar synthesis directive attributes for this function
ATTRIBUTE synthesis_return OF result:VARIABLE IS "REDUCE_OR" ;
BEGIN
result := '0';
FOR i IN arg'RANGE LOOP
result := result OR arg(i);
END LOOP;
RETURN result;
END;
FUNCTION nor_reduce(arg: STD_LOGIC_VECTOR) RETURN STD_LOGIC IS
VARIABLE result: STD_LOGIC;
ATTRIBUTE synthesis_RETURN OF result:VARIABLE IS "REDUCE_NOR" ;
BEGIN
result := NOT or_reduce(arg);
RETURN result;
END;
FUNCTION xor_reduce(arg: STD_LOGIC_VECTOR) RETURN STD_LOGIC IS
VARIABLE result: STD_LOGIC;
-- Exemplar synthesis directive attributes for this function
ATTRIBUTE synthesis_return OF result:VARIABLE IS "REDUCE_XOR" ;
BEGIN
result := '0';
FOR i IN arg'RANGE LOOP
result := result XOR arg(i);
END LOOP;
RETURN result;
END;
FUNCTION xnor_reduce(arg: STD_LOGIC_VECTOR) RETURN STD_LOGIC IS
VARIABLE result: STD_LOGIC;
ATTRIBUTE synthesis_RETURN OF result:VARIABLE IS "REDUCE_XNOR" ;
BEGIN
result := NOT xor_reduce(arg);
RETURN result;
END;
function TO_STD_LOGIC(arg : BOOLEAN) return STD_LOGIC is
begin
if(arg = true) then
return('1');
else
return('0');
end if;
end;
FUNCTION A_SRL(arg : STD_LOGIC_VECTOR; shift : STD_LOGIC_VECTOR) RETURN STD_LOGIC_VECTOR IS
BEGIN
RETURN(A_SRL(arg,conv_integer(shift)));
END;
FUNCTION A_SLL(arg : STD_LOGIC_VECTOR; shift : STD_LOGIC_VECTOR) RETURN STD_LOGIC_VECTOR IS
BEGIN
RETURN(A_SLL(arg,conv_integer(shift)));
END;
FUNCTION A_SRL(arg : STD_LOGIC_VECTOR; shift : INTEGER) RETURN STD_LOGIC_VECTOR IS
VARIABLE result : STD_LOGIC_VECTOR(arg'LEFT DOWNTO 0) := (arg'RANGE => '0');
BEGIN
IF ((shift <= arg'LEFT) AND (shift >= 0)) THEN
IF (shift = 0) THEN
result := arg;
ELSE
result(arg'LEFT - shift DOWNTO 0) := arg(arg'LEFT DOWNTO shift);
END IF;
END IF;
RETURN(result);
END;
FUNCTION A_SLL(arg : STD_LOGIC_VECTOR; shift : INTEGER) RETURN STD_LOGIC_VECTOR IS
VARIABLE result : STD_LOGIC_VECTOR(arg'LEFT DOWNTO 0) := (arg'RANGE => '0');
BEGIN
IF ((shift <= arg'LEFT) AND (shift >= 0)) THEN
IF (shift = 0) THEN
result := arg;
ELSE
result(arg'LEFT DOWNTO shift) := arg(arg'LEFT - shift DOWNTO 0);
END IF;
END IF;
RETURN(result);
END;
FUNCTION A_TOSTDLOGICVECTOR(a: std_logic) RETURN std_logic_vector IS
BEGIN
IF a = '1' THEN
return "1";
ELSE
return "0";
END IF;
END;
FUNCTION A_TOSTDLOGICVECTOR(a: std_logic_vector) RETURN std_logic_vector IS
BEGIN
return a;
END;
FUNCTION A_WE_StdLogic (select_arg: boolean; then_arg: STD_LOGIC ; else_arg:STD_LOGIC) RETURN STD_LOGIC IS
BEGIN
IF (select_arg) THEN
return (then_arg);
ELSE
return (else_arg);
END IF;
END;
FUNCTION A_WE_StdUlogic (select_arg: boolean; then_arg: STD_ULOGIC; else_arg:STD_ULOGIC) RETURN STD_ULOGIC IS
BEGIN
IF (select_arg) THEN
return (then_arg);
ELSE
return (else_arg);
END IF;
END;
FUNCTION A_WE_StdLogicVector(select_arg: boolean; then_arg: STD_LOGIC_VECTOR; else_arg:STD_LOGIC_VECTOR) RETURN STD_LOGIC_VECTOR IS
BEGIN
IF (select_arg) THEN
return (then_arg);
ELSE
return (else_arg);
END IF;
END;
FUNCTION A_WE_StdUlogicVector(select_arg: boolean; then_arg: STD_ULOGIC_VECTOR; else_arg:STD_ULOGIC_VECTOR) RETURN STD_ULOGIC_VECTOR IS
BEGIN
IF (select_arg) THEN
return (then_arg);
ELSE
return (else_arg);
END IF;
END;
FUNCTION Vector_To_Std_Logic(vector: STD_LOGIC_VECTOR)
return Std_Logic IS
BEGIN
return (vector(vector'right));
END;
FUNCTION a_rep(arg : STD_LOGIC; repeat : INTEGER) RETURN STD_LOGIC_VECTOR IS
VARIABLE result : STD_LOGIC_VECTOR(repeat-1 DOWNTO 0) := (others => '0');
VARIABLE i : integer := 0;
BEGIN
FOR i IN 0 TO (repeat-1) LOOP
result(i) := arg;
end LOOP;
RETURN(result);
END;
FUNCTION a_rep_vector(arg : STD_LOGIC_VECTOR; repeat : INTEGER) RETURN STD_LOGIC_VECTOR IS
VARIABLE arg_copy : STD_LOGIC_VECTOR ((arg'length - 1)DOWNTO 0) := arg ;
VARIABLE result : STD_LOGIC_VECTOR(((repeat * (arg_copy'LEFT+1))-1) DOWNTO 0) := (others => '0');
VARIABLE i : integer := 0;
BEGIN
FOR i IN 0 TO (repeat-1) LOOP
result((((arg_copy'left + 1) * i) + arg_copy'left) downto ((arg_copy'left + 1) * i)) := arg_copy(arg_copy'LEFT DOWNTO 0);
end LOOP;
RETURN(result);
END;
-- a_min : return the minimum of two integers;
function a_min(L, R: INTEGER) return INTEGER is
begin
if L < R then
return L;
else
return R;
end if;
end;
-- a_max : return the minimum of two integers;
function a_max(L, R: INTEGER) return INTEGER is
begin
if L > R then
return L;
else
return R;
end if;
end;
-- a_ext is the Altera version of the EXT function. It is used to both
-- zero-extend a signal to a new length, and to extract a signal of 'size'
-- length from a larger signal.
FUNCTION a_ext (arg : STD_LOGIC_VECTOR; size : INTEGER) RETURN STD_LOGIC_VECTOR IS
VARIABLE arg_copy : STD_LOGIC_VECTOR ((arg'length - 1)DOWNTO 0) := arg ;
VARIABLE result : STD_LOGIC_VECTOR((size-1) DOWNTO 0) := (others => '0');
VARIABLE i : integer := 0;
VARIABLE bits_to_copy : integer := 0;
VARIABLE arg_length : integer := arg'length ;
VARIABLE LSB_bit : integer := 0;
BEGIN
bits_to_copy := a_min(arg_length, size);
FOR i IN 0 TO (bits_to_copy - 1) LOOP
result(i) := arg_copy(i);
end LOOP;
RETURN(result);
END;
-------------------------------------------------------
-- Conversions for Verilog $display/$write emulation --
-------------------------------------------------------
subtype slv4 is std_logic_vector(1 to 4);
subtype slv3 is std_logic_vector(1 to 3);
-- Remove leading zeros. Also changes strings of all 'x' or 'z' to one char.
-- This handles the %0<radix> kind of Verilog syntax in the format string.
-- Examples:
-- input output
-- ----- -----------
-- 001f 1f
-- 0000 0
-- xxxx x
-- zzzz z
-- xxzz xxzz
function do_pad_none(
str_in : string) return string is
variable start : integer;
variable all_x : boolean := true;
variable all_z : boolean := true;
begin
-- Nothing to remove if string isn't at least two characters long.
if (str_in'length < 2) then
return str_in;
end if;
for i in str_in'range loop
case str_in(i) is
when 'X' | 'x' => all_z := false;
when 'Z' | 'z' => all_x := false;
when others => all_x := false; all_z := false;
end case;
end loop;
if (all_x or all_z) then
return str_in(str_in'left to str_in'left);
end if;
-- Find index of first non-zero character.
for i in str_in'range loop
start := i;
exit when (str_in(i) /= '0');
end loop;
return str_in(start to str_in'right);
end do_pad_none;
-- Replace leading zeros with spaces.
-- This handles the %d kind of Verilog syntax in the format string.
function replace_leading_zeros(
str_in : string;
c : character) return string is
variable str_out : string(str_in'range) := str_in;
begin
-- Nothing to replace if string isn't at least two characters long.
if (str_in'length < 2) then
return str_in;
end if;
for i in str_in'range loop
if (str_in(i) = '0') then
str_out(i) := c;
else
exit;
end if;
end loop;
return str_out;
end replace_leading_zeros;
function do_pad(
str : string;
pad : pad_type) return string is
begin
case pad is
when pad_none => return do_pad_none(str);
when pad_spaces => return replace_leading_zeros(str, ' ');
when pad_zeros => return str;
end case;
end do_pad;
function round_up_to_multiple(
val : integer;
size : integer) return integer is
begin
return ((val + size - 1) / size) * size;
end round_up_to_multiple;
function to_hex_string(
val : std_logic_vector;
pad : pad_type := pad_zeros) return string is
variable ext_len : integer := round_up_to_multiple(val'length,4);
variable val_ext : std_logic_vector(1 to ext_len) := (others => '0');
variable ptr : integer range 1 to (ext_len/4)+1 := 1;
variable str : string(1 to ext_len/4) := (others=>'0');
variable found_x : boolean := false;
variable found_z : boolean := false;
begin
val_ext(ext_len-val'length+1 to ext_len) := val;
-- Extend MSB to extended sulv unless it starts with one (unsigned).
-- Done to extend 'x' and 'z'.
if ext_len-val'length > 0 and val(val'left) /= '1' then
val_ext(1 to ext_len-val'length) := (others => val(val'left));
end if;
for i in val_ext'range loop
next when i rem 4 /= 1;
case slv4(to_x01z(val_ext(i to i+3))) is
when "0000" => str(ptr) := '0';
when "0001" => str(ptr) := '1';
when "0010" => str(ptr) := '2';
when "0011" => str(ptr) := '3';
when "0100" => str(ptr) := '4';
when "0101" => str(ptr) := '5';
when "0110" => str(ptr) := '6';
when "0111" => str(ptr) := '7';
when "1000" => str(ptr) := '8';
when "1001" => str(ptr) := '9';
when "1010" => str(ptr) := 'a';
when "1011" => str(ptr) := 'b';
when "1100" => str(ptr) := 'c';
when "1101" => str(ptr) := 'd';
when "1110" => str(ptr) := 'e';
when "1111" => str(ptr) := 'f';
when "XXXX" => str(ptr) := 'x';
when "ZZZZ" => str(ptr) := 'z';
when others =>
for j in 0 to 3 loop
case val_ext(i + j) is
when 'X' => found_x := true;
when 'Z' => found_z := true;
when others => null;
end case;
end loop;
if found_x then
str(ptr) := 'X';
elsif found_z then
str(ptr) := 'Z';
else
str(ptr) := 'X';
end if;
end case;
ptr := ptr + 1;
end loop;
return do_pad(str, pad);
end to_hex_string;
function to_decimal_string(
val : integer;
pad : pad_type := pad_spaces) return string is
variable tmp : integer := val;
variable ptr : integer range 1 to 32 := 32;
variable str : string(1 to 32) := (others=>'0');
begin
if val=0 then
return do_pad("0", pad);
else
while tmp > 0 loop
case tmp rem 10 is
when 0 => str(ptr) := '0';
when 1 => str(ptr) := '1';
when 2 => str(ptr) := '2';
when 3 => str(ptr) := '3';
when 4 => str(ptr) := '4';
when 5 => str(ptr) := '5';
when 6 => str(ptr) := '6';
when 7 => str(ptr) := '7';
when 8 => str(ptr) := '8';
when 9 => str(ptr) := '9';
when others => null;
end case;
tmp := tmp / 10;
ptr := ptr - 1;
end loop;
return do_pad(str(ptr+1 to 32), pad);
end if;
end to_decimal_string;
function to_decimal_string(
val : std_logic_vector;
pad : pad_type := pad_spaces) return string is
variable all_x : boolean := true;
variable all_z : boolean := true;
variable some_x : boolean := false;
variable some_z : boolean := false;
variable fixed_str : string(1 to 1);
begin
for i in val'range loop
case to_x01z(val(i)) is
when 'X' => some_x := true; all_z := false;
when 'Z' => some_z := true; all_x := false;
when others => all_x := false; all_z := false;
end case;
end loop;
if (all_x) then
fixed_str(1) := 'x';
return fixed_str;
elsif (all_z) then
fixed_str(1) := 'z';
return fixed_str;
elsif (some_x) then
fixed_str(1) := 'X';
return fixed_str;
elsif (some_z) then
fixed_str(1) := 'Z';
return fixed_str;
else
return to_decimal_string(conv_integer(val), pad);
end if;
end to_decimal_string;
function to_octal_string(
val : std_logic_vector;
pad : pad_type := pad_zeros) return string is
variable ext_len : integer := round_up_to_multiple(val'length,3);
variable val_ext : std_logic_vector(1 to ext_len) := (others => '0');
variable ptr : integer range 1 to (ext_len/3)+1 := 1;
variable str : string(1 to ext_len/3) := (others=>'0');
variable found_x : boolean := false;
variable found_z : boolean := false;
begin
val_ext(ext_len-val'length+1 to ext_len) := val;
-- Extend MSB to extended sulv unless it starts with one (unsigned).
-- Done to extend 'x' and 'z'.
if ext_len-val'length > 0 and val(val'left) /= '1' then
val_ext(1 to ext_len-val'length) := (others => val(val'left));
end if;
for i in val_ext'range loop
next when i rem 3 /= 1;
case slv3(to_x01z(val_ext(i to i+2))) is
when "000" => str(ptr) := '0';
when "001" => str(ptr) := '1';
when "010" => str(ptr) := '2';
when "011" => str(ptr) := '3';
when "100" => str(ptr) := '4';
when "101" => str(ptr) := '5';
when "110" => str(ptr) := '6';
when "111" => str(ptr) := '7';
when "XXX" => str(ptr) := 'x';
when "ZZZ" => str(ptr) := 'z';
when others =>
for j in 0 to 2 loop
case val_ext(i + j) is
when 'X' => found_x := true;
when 'Z' => found_z := true;
when others => null;
end case;
end loop;
if found_x then
str(ptr) := 'X';
elsif found_z then
str(ptr) := 'Z';
else
str(ptr) := 'X';
end if;
end case;
ptr := ptr + 1;
end loop;
return do_pad(str, pad);
end to_octal_string;
function to_hex_string(
val : std_logic;
pad : pad_type := pad_zeros) return string is
begin
return to_binary_string(val, pad);
end to_hex_string;
function to_decimal_string(
val : std_logic;
pad : pad_type := pad_spaces) return string is
begin
return to_binary_string(val, pad);
end to_decimal_string;
function to_octal_string(
val : std_logic;
pad : pad_type := pad_zeros) return string is
begin
return to_binary_string(val, pad);
end to_octal_string;
function to_binary_string(
val : std_logic;
pad : pad_type := pad_zeros) return string is
variable str : string(1 to 1);
begin
case to_x01z(val) is
when '0' => str(1) := '0';
when '1' => str(1) := '1';
when 'X' => str(1) := 'x';
when 'Z' => str(1) := 'z';
when others => str(1) := 'x';
end case;
return do_pad(str, pad);
end to_binary_string;
function to_binary_string(
val : std_logic_vector;
pad : pad_type := pad_zeros) return string is
variable str : string(1 to val'length) := (others=>'0');
variable ptr : integer := str'left;
begin
for i in val'range loop
str(ptr to ptr) := to_binary_string(val(i));
ptr := ptr + 1;
end loop;
return do_pad(str, pad);
end to_binary_string;
end altera_europa_support_lib;
@@ -0,0 +1,40 @@
-----------------------------------------------------------------------------
-- --
-- Copyright (c) 2003 by Altera Corp. All rights reserved. --
-- --
-- --
-- Description: Declares utility package for internal Altera synthesis --
-- support. --
-- --
-- --
-- *** USER DESIGNS SHOULD NOT INCLUDE THIS PACKAGE DIRECTLY *** --
-- --
------------------------------------------------------------------------------
PACKAGE altera_internal_syn is
-- Specfies a built-in pragma function that should replace a user-defined
-- subprogram during synthesis.
ATTRIBUTE synthesis_return : STRING;
-- If a subprogram specifies a synthesis_return attribute, it may also
-- use these additional attributes to fine-tune the behavior of a built-in
-- function.
-- Specifies the method for calculating the size of a unary or binary
-- built-in pragma function's result. The following values are supported:
--
-- LEFT: Use the size of the left operand
-- RIGHT: Use the size of the right operand
-- MAX_LEFT_RIGHT: Use the maximum of the left and right operands
ATTRIBUTE synthesis_result_size : STRING;
-- Flag that indicates if a type or an argument/result of a built-in pragma
-- function is signed (TRUE) or unsigned (FALSE).
ATTRIBUTE is_signed : BOOLEAN;
-- Flag that indicates if truncation should preserve the sign bit
attribute signed_truncation : BOOLEAN;
END altera_internal_syn;
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,435 @@
-- Copyright (C) 1991-2015 Altera Corporation. All rights reserved.
-- Your use of Altera Corporation's design tools, logic functions
-- and other software and tools, and its AMPP partner logic
-- functions, and any output files from any of the foregoing
-- (including device programming or simulation files), and any
-- associated documentation or information are expressly subject
-- to the terms and conditions of the Altera Program License
-- Subscription Agreement, the Altera Quartus II License Agreement,
-- the Altera MegaCore Function License Agreement, or other
-- applicable license agreement, including, without limitation,
-- that your use is for the sole purpose of programming logic
-- devices manufactured by Altera and sold by Altera or its
-- authorized distributors. Please refer to the applicable
-- agreement for further details.
----------------------------------------------------------------------------
-- ALtera Primitives Component Declaration File
----------------------------------------------------------------------------
library IEEE;
use IEEE.std_logic_1164.all;
use IEEE.VITAL_Timing.all;
use IEEE.VITAL_Primitives.all;
package dffeas_pack is
-- default generic values
CONSTANT DefWireDelay : VitalDelayType01 := (0 ns, 0 ns);
CONSTANT DefPropDelay01 : VitalDelayType01 := (0 ns, 0 ns);
CONSTANT DefPropDelay01Z : VitalDelayType01Z := (OTHERS => 0 ns);
CONSTANT DefSetupHoldCnst : TIME := 0 ns;
CONSTANT DefPulseWdthCnst : TIME := 0 ns;
CONSTANT DefGlitchMode : VitalGlitchKindType := VitalTransport;
CONSTANT DefGlitchMsgOn : BOOLEAN := FALSE;
CONSTANT DefGlitchXOn : BOOLEAN := FALSE;
CONSTANT DefMsgOnChecks : BOOLEAN := TRUE;
CONSTANT DefXOnChecks : BOOLEAN := TRUE;
end dffeas_pack;
library ieee;
use ieee.std_logic_1164.all;
use IEEE.VITAL_Timing.all;
use work.dffeas_pack.all;
package altera_primitives_components is
component carry
port (
a_in : in std_logic;
a_out : out std_logic );
end component;
component cascade
port (
a_in : in std_logic;
a_out : out std_logic );
end component;
component global
port (
a_in : in std_logic;
a_out : out std_logic);
end component;
component tri
port(
a_in : in std_logic;
oe : in std_logic;
a_out : out std_logic);
end component;
component carry_sum
port (
sin : in std_logic;
cin : in std_logic;
sout : out std_logic;
cout : out std_logic );
end component;
component exp
port (
a_in : in std_logic;
a_out : out std_logic);
end component;
component soft
port (
a_in : in std_logic;
a_out : out std_logic );
end component;
component opndrn
port (
a_in : in std_logic;
a_out : out std_logic );
end component;
component row_global
port (
a_in : in std_logic;
a_out : out std_logic );
end component;
component lut_input
port(
a_in : in std_logic;
a_out : out std_logic);
end component;
component lut_output
port(
a_in : in std_logic;
a_out : out std_logic);
end component;
component dlatch
port(
d : in std_logic;
ena : in std_logic;
clrn : in std_logic;
prn : in std_logic;
q : out std_logic);
end component;
component latch
port(
d : in std_logic;
ena : in std_logic;
q : out std_logic);
end component;
component dff
port(
d, clk, clrn, prn : in std_logic;
q : out std_logic);
end component;
component dffe
port(
d, clk, ena, clrn, prn : in std_logic;
q : out std_logic);
end component;
component dffea
port(
d, clk, ena, clrn, prn, aload, adata : in std_logic;
q : out std_logic);
end component;
component dffeas
generic (
power_up : string := "DONT_CARE";
is_wysiwyg : string := "false";
dont_touch : string := "false";
x_on_violation : string := "on";
lpm_type : string := "DFFEAS";
tsetup_d_clk_noedge_posedge : VitalDelayType := DefSetupHoldCnst;
tsetup_asdata_clk_noedge_posedge : VitalDelayType := DefSetupHoldCnst;
tsetup_sclr_clk_noedge_posedge : VitalDelayType := DefSetupHoldCnst;
tsetup_sload_clk_noedge_posedge : VitalDelayType := DefSetupHoldCnst;
tsetup_ena_clk_noedge_posedge : VitalDelayType := DefSetupHoldCnst;
thold_d_clk_noedge_posedge : VitalDelayType := DefSetupHoldCnst;
thold_asdata_clk_noedge_posedge : VitalDelayType := DefSetupHoldCnst;
thold_sclr_clk_noedge_posedge : VitalDelayType := DefSetupHoldCnst;
thold_sload_clk_noedge_posedge : VitalDelayType := DefSetupHoldCnst;
thold_ena_clk_noedge_posedge : VitalDelayType := DefSetupHoldCnst;
tpd_clk_q_posedge : VitalDelayType01 := DefPropDelay01;
tpd_clrn_q_negedge : VitalDelayType01 := DefPropDelay01;
tpd_prn_q_negedge : VitalDelayType01 := DefPropDelay01;
tpd_aload_q_posedge : VitalDelayType01 := DefPropDelay01;
tpd_asdata_q: VitalDelayType01 := DefPropDelay01;
tipd_clk : VitalDelayType01 := DefPropDelay01;
tipd_d : VitalDelayType01 := DefPropDelay01;
tipd_asdata : VitalDelayType01 := DefPropDelay01;
tipd_sclr : VitalDelayType01 := DefPropDelay01;
tipd_sload : VitalDelayType01 := DefPropDelay01;
tipd_clrn : VitalDelayType01 := DefPropDelay01;
tipd_prn : VitalDelayType01 := DefPropDelay01;
tipd_aload : VitalDelayType01 := DefPropDelay01;
tipd_ena : VitalDelayType01 := DefPropDelay01;
TimingChecksOn: Boolean := True;
MsgOn: Boolean := DefGlitchMsgOn;
XOn: Boolean := DefGlitchXOn;
MsgOnChecks: Boolean := DefMsgOnChecks;
XOnChecks: Boolean := DefXOnChecks;
InstancePath: STRING := "*" );
port (
d : in std_logic := '0';
clk : in std_logic := '0';
ena : in std_logic := '1';
clrn : in std_logic := '1';
prn : in std_logic := '1';
aload : in std_logic := '0';
asdata : in std_logic := '1';
sclr : in std_logic := '0';
sload : in std_logic := '0';
devclrn : in std_logic := '1';
devpor : in std_logic := '1';
q : out std_logic );
end component;
component tff
port(
t, clk, clrn, prn : in std_logic;
q : out std_logic);
end component;
component tffe
port(
t, clk, ena, clrn, prn : in std_logic;
q : out std_logic);
end component;
component jkff
port(
j, k, clk, clrn, prn : in std_logic;
q : out std_logic);
end component;
component jkffe
port(
j, k, clk, ena, clrn, prn : in std_logic;
q : out std_logic);
end component;
component srff
port(
s, r, clk, clrn, prn : in std_logic;
q : out std_logic);
end component;
component srffe
port(
s, r, clk, ena, clrn, prn : in std_logic;
q : out std_logic);
end component;
component clklock
generic(
input_frequency : natural := 10000;
clockboost : natural := 1);
port(
inclk : in std_logic;
outclk : out std_logic);
end component;
component alt_inbuf
generic(
io_standard : string := "NONE";
location : string := "NONE";
enable_bus_hold : string := "NONE";
weak_pull_up_resistor : string := "NONE";
termination : string := "NONE";
lpm_type : string := "alt_inbuf" );
port(
i : in std_logic;
o : out std_logic);
end component;
component alt_outbuf
generic(
io_standard : string := "NONE";
current_strength : string := "NONE";
current_strength_new : string := "NONE";
slew_rate : integer := -1;
slow_slew_rate : string := "NONE";
location : string := "NONE";
enable_bus_hold : string := "NONE";
weak_pull_up_resistor : string := "NONE";
termination : string := "NONE";
lpm_type : string := "alt_outbuf" );
port(
i : in std_logic;
o : out std_logic);
end component;
component alt_outbuf_tri
generic(
io_standard : string := "NONE";
current_strength : string := "NONE";
current_strength_new : string := "NONE";
slew_rate : integer := -1;
slow_slew_rate : string := "NONE";
location : string := "NONE";
enable_bus_hold : string := "NONE";
weak_pull_up_resistor : string := "NONE";
termination : string := "NONE";
lpm_type : string := "alt_outbuf_tri" );
port(
i : in std_logic;
oe : in std_logic;
o : out std_logic);
end component;
component alt_iobuf
generic(
io_standard : string := "NONE";
current_strength : string := "NONE";
current_strength_new : string := "NONE";
slew_rate : integer := -1;
slow_slew_rate : string := "NONE";
location : string := "NONE";
enable_bus_hold : string := "NONE";
weak_pull_up_resistor : string := "NONE";
termination : string := "NONE";
input_termination : string := "NONE";
output_termination : string := "NONE";
lpm_type : string := "alt_iobuf" );
port(
i : in std_logic;
oe : in std_logic;
io : inout std_logic;
o : out std_logic);
end component;
component alt_inbuf_diff
generic(
io_standard : string := "NONE";
location : string := "NONE";
enable_bus_hold : string := "NONE";
weak_pull_up_resistor : string := "NONE";
termination : string := "NONE";
lpm_type : string := "alt_inbuf_diff" );
port(
i : in std_logic;
ibar : in std_logic;
o : out std_logic);
end component;
component alt_outbuf_diff
generic (
io_standard : string := "NONE";
current_strength : string := "NONE";
current_strength_new : string := "NONE";
slew_rate : integer := -1;
location : string := "NONE";
enable_bus_hold : string := "NONE";
weak_pull_up_resistor : string := "NONE";
termination : string := "NONE";
lpm_type : string := "alt_outbuf_diff" );
port(
i : in std_logic;
o : out std_logic;
obar : out std_logic );
end component;
component alt_outbuf_tri_diff
generic (
io_standard : string := "NONE";
current_strength : string := "NONE";
current_strength_new : string := "NONE";
slew_rate : integer := -1;
location : string := "NONE";
enable_bus_hold : string := "NONE";
weak_pull_up_resistor : string := "NONE";
termination : string := "NONE";
lpm_type : string := "alt_outbuf_tri_diff" );
port(
i : in std_logic;
oe : in std_logic;
o : out std_logic;
obar : out std_logic );
end component;
component alt_iobuf_diff
generic (
io_standard : string := "NONE";
current_strength : string := "NONE";
current_strength_new : string := "NONE";
slew_rate : integer := -1;
location : string := "NONE";
enable_bus_hold : string := "NONE";
weak_pull_up_resistor : string := "NONE";
termination : string := "NONE";
input_termination : string := "NONE";
output_termination : string := "NONE";
lpm_type : string := "alt_iobuf_diff" );
port(
i : in std_logic;
oe : in std_logic;
io : inout std_logic;
iobar : inout std_logic;
o : out std_logic );
end component;
component alt_bidir_diff
generic (
io_standard : string := "NONE";
current_strength : string := "NONE";
current_strength_new : string := "NONE";
slew_rate : integer := -1;
location : string := "NONE";
enable_bus_hold : string := "NONE";
weak_pull_up_resistor : string := "NONE";
termination : string := "NONE";
input_termination : string := "NONE";
output_termination : string := "NONE";
lpm_type : string := "alt_bidir_diff" );
port(
oe : in std_logic;
bidirin : inout std_logic;
io : inout std_logic;
iobar : inout std_logic );
end component;
component alt_bidir_buf
generic (
io_standard : string := "NONE";
current_strength : string := "NONE";
current_strength_new : string := "NONE";
slew_rate : integer := -1;
location : string := "NONE";
enable_bus_hold : string := "NONE";
weak_pull_up_resistor : string := "NONE";
termination : string := "NONE";
input_termination : string := "NONE";
output_termination : string := "NONE";
lpm_type : string := "alt_bidir_buf" );
port(
oe : in std_logic;
bidirin : inout std_logic;
io : inout std_logic );
end component;
end altera_primitives_components;
@@ -0,0 +1,45 @@
-- Copyright (C) 1991-2015 Altera Corporation. All rights reserved.
-- Your use of Altera Corporation's design tools, logic functions
-- and other software and tools, and its AMPP partner logic
-- functions, and any output files from any of the foregoing
-- (including device programming or simulation files), and any
-- associated documentation or information are expressly subject
-- to the terms and conditions of the Altera Program License
-- Subscription Agreement, the Altera Quartus II License Agreement,
-- the Altera MegaCore Function License Agreement, or other
-- applicable license agreement, including, without limitation,
-- that your use is for the sole purpose of programming logic
-- devices manufactured by Altera and sold by Altera or its
-- authorized distributors. Please refer to the applicable
-- agreement for further details.
library std;
use std.standard.all;
package altera_standard_functions is
function maximum (L, R: integer) return integer;
function minimum (L, R: integer) return integer;
end altera_standard_functions;
package body altera_standard_functions is
function maximum (L, R: integer) return integer is
begin
if L > R then
return L;
else
return R;
end if;
end maximum;
function minimum (L, R: integer) return integer is
begin
if L > R then
return R;
else
return L;
end if;
end minimum;
end altera_standard_functions;
@@ -0,0 +1,94 @@
-- Copyright (C) 1991-2015 Altera Corporation. All rights reserved.
-- Your use of Altera Corporation's design tools, logic functions
-- and other software and tools, and its AMPP partner logic
-- functions, and any output files from any of the foregoing
-- (including device programming or simulation files), and any
-- associated documentation or information are expressly subject
-- to the terms and conditions of the Altera Program License
-- Subscription Agreement, the Altera Quartus II License Agreement,
-- the Altera MegaCore Function License Agreement, or other
-- applicable license agreement, including, without limitation,
-- that your use is for the sole purpose of programming logic
-- devices manufactured by Altera and sold by Altera or its
-- authorized distributors. Please refer to the applicable
-- agreement for further details.
-----------------------------------------------------------------------------
-- --
-- Copyright (c) 2006 by Altera Corp. All rights reserved. --
-- --
-- --
-- Description: Package containing Attribute Declarations for all --
-- attributes that control Quartus II Integrated Synthesis. --
-- Please refer to the Quartus II Help for documentation --
-- on using these attributes. --
-- --
-- --
-----------------------------------------------------------------------------
library std;
use std.standard.all;
PACKAGE altera_syn_attributes is
-- Directs Quartus II to implement input, output, and output
-- enable registers in I/O cells that have fast, direct connections to
-- an I/O pin, when possible
ATTRIBUTE useioff : BOOLEAN;
-- Prevents Quartus II from minimizing or removing a register
ATTRIBUTE preserve : BOOLEAN;
-- Prevents Quartus II from removing a dangling register
ATTRIBUTE noprune : BOOLEAN;
-- Prevents Quartus II from merging a register with a duplicate
ATTRIBUTE dont_merge : BOOLEAN;
-- Prevents Quartus II from replicating a register to improve timing
ATTRIBUTE dont_replicate : BOOLEAN;
-- Prevents Quartus II from retiming a register
ATTRIBUTE dont_retime : BOOLEAN;
-- Identifies the critical clock enable signal for a register. The
-- Quartus II software will attempt to connect this signal to the
-- dedicated clock enable port.
ATTRIBUTE direct_enable : BOOLEAN;
-- Prevents Quartus II from minimizing or removing a particular
-- signal net during combinational logic optimization
ATTRIBUTE keep : BOOLEAN;
-- Sets a fan-out limit on a register or net.
ATTRIBUTE maxfan : NATURAL;
-- Controls the implementation of a multiplication (*) operations in VHDL
ATTRIBUTE multstyle : STRING;
-- Controls the implementation of inferred memories
ATTRIBUTE ramstyle : STRING;
-- Controls the implementation of inferred ROMs
ATTRIBUTE romstyle : STRING;
-- Specifies a Memory Initialization File (.mif) for an inferred RAM
ATTRIBUTE ram_init_file : STRING;
-- Assigns a logic encoding to an enumerated type. Prevents state
-- machine extraction for all objects with the enumerated type.
ATTRIBUTE enum_encoding : STRING;
-- Assigns a state encoding to an enumerated type that models the states
-- of an extracted state machine.
ATTRIBUTE syn_encoding : STRING;
-- Specifies device pin assignments for a VHDL entity port
ATTRIBUTE chip_pin : STRING;
-- Applies an arbitrary number of Quartus Settings File (QSF) assignments
-- to a signal, entity, architecture, instance, or inferred register
ATTRIBUTE altera_attribute : STRING;
END altera_syn_attributes;
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,242 @@
-----------------------------------------------------------------------------
-- --
-- Copyright (c) 1996 by Altera Corp. All rights reserved. --
-- --
-- --
-- Description: Package file for Altera mega functions. --
-- --
-- --
------------------------------------------------------------------------------
library ieee;
use ieee.std_logic_1164.all;
package megacore is
component a16450
port (
mr : IN std_logic;
clk : IN std_logic;
a : IN std_logic_vector(2 downto 0);
din : IN std_logic_vector(7 downto 0);
cs0 : IN std_logic;
cs1 : IN std_logic;
ncs2 : IN std_logic;
nads : IN std_logic;
rd : IN std_logic;
nrd : IN std_logic;
wr : IN std_logic;
nwr : IN std_logic;
sin : IN std_logic;
rclk : IN std_logic;
ncts : IN std_logic;
ndsr : IN std_logic;
ndcd : IN std_logic;
nri : IN std_logic;
dout : OUT std_logic_vector(7 downto 0);
ddis : OUT std_logic;
csout : OUT std_logic;
sout : OUT std_logic;
nbaudout : OUT std_logic;
nrts : OUT std_logic;
ndtr : OUT std_logic;
nout1 : OUT std_logic;
nout2 : OUT std_logic;
intr : OUT std_logic
);
end component;
component a6402
port (
cls1 : IN std_logic;
cls2 : IN std_logic;
crl : IN std_logic;
ndrr : IN std_logic;
epe : IN std_logic;
mr : IN std_logic;
pi : IN std_logic;
rrc : IN std_logic;
rri : IN std_logic;
sbs : IN std_logic;
tbr : IN std_logic_vector(7 downto 0);
ntbrl : IN std_logic;
trc : IN std_logic;
dr : OUT std_logic;
fe : OUT std_logic;
oe : OUT std_logic;
pe : OUT std_logic;
rbr : OUT std_logic_vector(7 downto 0);
tbre : OUT std_logic;
tro : OUT std_logic;
tre : OUT std_logic
);
end component;
component a6850
port (
nreset : IN std_logic;
di : IN std_logic_vector(7 downto 0);
e : IN std_logic;
rnw : IN std_logic;
cs : IN std_logic_vector(2 downto 0);
rs : IN std_logic;
txclk : IN std_logic;
rxclk : IN std_logic;
rxdata : IN std_logic;
ncts : IN std_logic;
ndcd : IN std_logic;
do : OUT std_logic_vector(7 downto 0);
nirq : OUT std_logic;
txdata : OUT std_logic;
nrts : OUT std_logic
);
end component;
component a8237
port (
reset : IN std_logic;
clk : IN std_logic;
ncs : IN std_logic;
niorin : IN std_logic;
niowin : IN std_logic;
ready : IN std_logic;
hlda : IN std_logic;
neopin : IN std_logic;
ain : IN std_logic_vector(3 downto 0);
dreq : IN std_logic_vector(3 downto 0);
dbin : IN std_logic_vector(7 downto 0);
dbout : OUT std_logic_vector(7 downto 0);
dben : OUT std_logic;
aout : OUT std_logic_vector(7 downto 0);
hrq : OUT std_logic;
dack : OUT std_logic_vector(3 downto 0);
aen : OUT std_logic;
adstb : OUT std_logic;
niorout : OUT std_logic;
niowout : OUT std_logic;
nmemr : OUT std_logic;
nmemw : OUT std_logic;
neopout : OUT std_logic;
dmaenable : OUT std_logic
);
end component;
component a8251
port (
clk : IN std_logic;
nreset : IN std_logic;
nwr : IN std_logic;
nrd : IN std_logic;
ncs : IN std_logic;
cnd : IN std_logic;
ndsr : IN std_logic;
ncts : IN std_logic;
extsyncd : IN std_logic;
ntxc : IN std_logic;
nrxc : IN std_logic;
rxd : IN std_logic;
din : IN std_logic_vector(7 downto 0);
txd : OUT std_logic;
txrdy : OUT std_logic;
txempty : OUT std_logic;
rxrdy : OUT std_logic;
ndtr : OUT std_logic;
nrts : OUT std_logic;
syn_brk : OUT std_logic;
nen : OUT std_logic;
dout : OUT std_logic_vector(7 downto 0)
);
end component;
component a8255
port (
reset : IN std_logic;
clk : IN std_logic;
ncs : IN std_logic;
nrd : IN std_logic;
nwr : IN std_logic;
a : IN std_logic_vector(1 downto 0);
din : IN std_logic_vector(7 downto 0);
pain : IN std_logic_vector(7 downto 0);
pbin : IN std_logic_vector(7 downto 0);
pcin : IN std_logic_vector(7 downto 0);
dout : OUT std_logic_vector(7 downto 0);
paout : OUT std_logic_vector(7 downto 0);
paen : OUT std_logic;
pbout : OUT std_logic_vector(7 downto 0);
pben : OUT std_logic;
pcout : OUT std_logic_vector(7 downto 0);
pcen : OUT std_logic_vector(7 downto 0)
);
end component;
component rgb2ycrcb
port (
R : IN std_logic_vector(7 downto 0);
G : IN std_logic_vector(7 downto 0);
B : IN std_logic_vector(7 downto 0);
CLOCK : IN std_logic := '0';
ACLR : IN std_logic := '0';
Y : OUT std_logic_vector(15 downto 0);
Cr: OUT std_logic_vector(14 downto 0);
Cb: OUT std_logic_vector(14 downto 0)
);
end component;
component ycrcb2rgb
port (
Y : IN std_logic_vector(7 downto 0);
CR : IN std_logic_vector(7 downto 0);
CB : IN std_logic_vector(7 downto 0);
CLOCK : IN std_logic := '0';
ACLR : IN std_logic := '0';
R : OUT std_logic_vector(16 downto 0);
G: OUT std_logic_vector(16 downto 0);
B: OUT std_logic_vector(16 downto 0)
);
end component;
component a8259
port (
nmrst, clk, ncs, nwr, nrd, a0, nsp, ninta : IN std_logic;
casin : IN std_logic_vector(2 downto 0);
din, ir : IN std_logic_vector(7 downto 0);
nen, cas_en, int : OUT std_logic;
dout : OUT std_logic_vector(7 downto 0);
casout : OUT std_logic_vector(7 downto 0)
);
end component;
component fft
generic (
WIDTH_DATA : POSITIVE;
WIDTH_TWIDDLE : POSITIVE;
PIPE_DATA : INTEGER;
PIPE_TWIDDLE : INTEGER;
WIDTH_EXPONENT : POSITIVE;
WIDTH_ADD : POSITIVE;
EXPONENT_INITIAL_VALUE : INTEGER
);
port (
clock : IN std_logic := '0';
start_fft : IN std_logic;
data_left_in_re : IN std_logic_vector(WIDTH_DATA-1 downto 0);
data_left_in_im : IN std_logic_vector(WIDTH_DATA-1 downto 0);
data_right_in_re : IN std_logic_vector(WIDTH_DATA-1 downto 0);
data_right_in_im : IN std_logic_vector(WIDTH_DATA-1 downto 0);
twiddle_re : IN std_logic_vector(WIDTH_TWIDDLE-1 downto 0);
twiddle_im : IN std_logic_vector(WIDTH_TWIDDLE-1 downto 0);
done : OUT std_logic;
data_direction : OUT std_logic;
we_left : OUT std_logic;
add_left : OUT std_logic_vector(WIDTH_ADD-1 downto 0);
we_right : OUT std_logic;
add_right : OUT std_logic_vector(WIDTH_ADD-1 downto 0);
add_twiddle : OUT std_logic_vector(WIDTH_ADD-2 downto 0);
data_out_re : OUT std_logic_vector(WIDTH_DATA-1 downto 0);
data_out_im : OUT std_logic_vector(WIDTH_DATA-1 downto 0);
exponent : OUT std_logic_vector(WIDTH_EXPONENT-1 downto 0)
);
end component;
end megacore;
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,221 @@
--
-- Copyright (C) 1988-2002 Altera Corporation
--
-- Any megafunction design, and related net list (encrypted or decrypted),
-- support information, device programming or simulation file, and any
-- other associated documentation or information provided by Altera or a
-- partner under Altera's Megafunction Partnership Program may be used only
-- to program PLD devices (but not masked PLD devices) from Altera. Any
-- other use of such megafunction design, net list, support information,
-- device programming or simulation file, or any other related
-- documentation or information is prohibited for any other purpose,
-- including, but not limited to modification, reverse engineering, de-
-- compiling, or use with any other silicon devices, unless such use is
-- explicitly licensed under a separate agreement with Altera or a
-- megafunction partner. Title to the intellectual property, including
-- patents, copyrights, trademarks, trade secrets, or maskworks, embodied
-- in any such megafunction design, net list, support information, device
-- programming or simulation file, or any other related documentation or
-- information provided by Altera or a megafunction partner, remains with
-- Altera, the megafunction partner, or their respective licensors. No
-- other licenses, including any licenses needed under any third party's
-- intellectual property, are provided herein.
----------------------------------------------------------------------------
----------------------------------------------------------------------------
-- ALtera Stratix GX Megafunction Component Declaration File
--
library ieee;
use ieee.std_logic_1164.all;
package stratixgx_mf_components is
function get_rx_channel_width(use_generic_fifo, clk_out_mode_reference : string;
channel_width : integer) return integer;
function get_rx_dwidth_factor(use_generic_fifo, clk_out_mode_reference : string;
dwidth_factor : integer) return integer;
component altgxb
generic (
operation_mode : string := "DUPLEX";
loopback_mode : string := "NONE";
reverse_loopback_mode : string := "NONE";
protocol : string := "CUSTOM";
number_of_channels: integer := 20;
number_of_quads : integer := 1;
channel_width : positive := 20;
pll_inclock_period : integer := 20000;
data_rate : integer := 0;
data_rate_remainder : integer := 0;
rx_data_rate : integer := 0;
rx_data_rate_remainder : integer := 0;
use_8b_10b_mode : string := "OFF";
use_double_data_mode : string := "OFF";
dwidth_factor : integer := 1;
-- RX Mode
disparity_mode : string := "OFF";
cru_inclock_period : integer := 0; -- Units in ps
run_length : integer := 128;
run_length_enable : string := "OFF";
use_channel_align : string := "OFF";
use_auto_bit_slip : string := "OFF";
use_rate_match_fifo : string := "OFF";
use_symbol_align : string := "OFF";
align_pattern : string := "X";
align_pattern_length : integer := 0;
infiniband_invalid_code : integer := 0;
clk_out_mode_reference : string := "ON";
-- TX Mode
use_fifo_mode : string := "ON";
intended_device_family : string := "STRATIXGX";
force_disparity_mode : string := "OFF";
lpm_type : string := "altgxb";
tx_termination : integer := 0;
-- Quartus 2.2 New Parameters
-- common
use_self_test_mode : string := "OFF";
self_test_mode : integer := 0;
-- Receiver
use_equalizer_ctrl_signal : string := "OFF";
equalizer_ctrl_setting : integer := 0;
signal_threshold_select : integer := 80;
rx_bandwidth_type : string := "NEW_MEDIUM";
rx_enable_dc_coupling : string := "OFF";
use_vod_ctrl_signal : string := "OFF";
vod_ctrl_setting : integer := 1000;
use_preemphasis_ctrl_signal : string := "OFF";
preemphasis_ctrl_setting : integer := 0;
use_phase_shift : string := "ON";
pll_bandwidth_type : string := "LOW";
pll_use_dc_coupling : string := "OFF";
rx_ppm_setting : integer := 1000;
use_generic_fifo : string := "OFF";
use_rx_cruclk : string := "OFF";
use_rx_clkout : string := "OFF";
use_rx_coreclk : string := "OFF";
use_tx_coreclk : string := "OFF";
instantiate_transmitter_pll : string := "OFF";
consider_instantiate_transmitter_pll_param : string := "OFF";
rx_force_signal_detect : string := "OFF";
flip_rx_out : string := "OFF";
flip_tx_in : string := "OFF";
add_generic_fifo_we_synch_register : string := "OFF";
consider_enable_tx_8b_10b_i1i2_generation : string := "OFF";
enable_tx_8b_10b_i1i2_generation : string := "OFF";
for_engineering_sample_device : string := "ON";
device_family : string := ""
);
port (
inclk : in std_logic_vector(number_of_quads-1 downto 0) := (others => '0');
rx_coreclk : in std_logic_vector(number_of_channels - 1 downto 0) := (others => '0');
pll_areset : in std_logic_vector(number_of_quads-1 downto 0):= (others => '0');
rx_cruclk : in std_logic_vector(number_of_quads - 1 downto 0) := (others => '0');
rx_in : in std_logic_vector(number_of_channels-1 downto 0) := (others => '0');
rx_aclr : in std_logic_vector(number_of_channels - 1 downto 0) := (others => '0');
rx_bitslip : in std_logic_vector(number_of_channels-1 downto 0) := (others => '0');
rx_enacdet : in std_logic_vector(number_of_channels-1 downto 0):= (others => '0');
rx_we: in std_logic_vector(number_of_channels-1 downto 0) := (others => '0');
rx_re: in std_logic_vector(number_of_channels-1 downto 0):= (others => '0');
rx_slpbk : in std_logic_vector(number_of_channels-1 downto 0) := (others => '0');
rx_a1a2size : in std_logic_vector(number_of_channels-1 downto 0) := (others => '0');
rx_equalizerctrl : in std_logic_vector(number_of_channels * 3 -1 downto 0) := (others => '0');
rx_locktorefclk : in std_logic_vector(number_of_channels -1 downto 0) := (others => '0');
rx_locktodata : in std_logic_vector(number_of_channels -1 downto 0) := (others => '0');
tx_in : in std_logic_vector(channel_width * number_of_channels-1 downto 0) := (others => '0');
tx_coreclk : in std_logic_vector(number_of_channels - 1 downto 0) := (others => '0');
tx_aclr : in std_logic_vector(number_of_channels - 1 downto 0) := (others => '0');
tx_ctrlenable : in std_logic_vector(dwidth_factor * number_of_channels-1 downto 0) := (others => '0');
tx_forcedisparity : in std_logic_vector(dwidth_factor * number_of_channels-1 downto 0) := (others => '0');
tx_srlpbk : in std_logic_vector(number_of_channels-1 downto 0) := (others => '0');
tx_vodctrl : in std_logic_vector(number_of_channels * 3-1 downto 0) := (others => '0');
tx_preemphasisctrl: in std_logic_vector(number_of_channels * 3-1 downto 0) := (others => '0');
-- XGM Input ports, common for Both Rx and Tx Mode
txdigitalreset : in std_logic_vector(number_of_channels - 1 downto 0) := (others => '0');
rxdigitalreset : in std_logic_vector(number_of_channels - 1 downto 0) := (others => '0');
rxanalogreset : in std_logic_vector(number_of_channels - 1 downto 0) := (others => '0');
pllenable : in std_logic_vector(number_of_quads - 1 downto 0) := (others => '1');
pll_locked : out std_logic_vector(number_of_quads-1 downto 0);
coreclk_out : out std_logic_vector(number_of_quads-1 downto 0);
rx_out : out std_logic_vector(get_rx_channel_width(use_generic_fifo,
clk_out_mode_reference, channel_width) * number_of_channels-1 downto 0);
rx_clkout : out std_logic_vector(number_of_channels-1 downto 0);
rx_locked : out std_logic_vector(number_of_channels-1 downto 0);
rx_freqlocked : out std_logic_vector(number_of_channels-1 downto 0);
rx_rlv : out std_logic_vector(number_of_channels-1 downto 0);
rx_syncstatus : out std_logic_vector(get_rx_dwidth_factor(use_generic_fifo,
clk_out_mode_reference, dwidth_factor) * number_of_channels-1 downto 0);
rx_patterndetect : out std_logic_vector(get_rx_dwidth_factor(use_generic_fifo,
clk_out_mode_reference, dwidth_factor) * number_of_channels-1 downto 0);
rx_ctrldetect : out std_logic_vector(get_rx_dwidth_factor(use_generic_fifo,
clk_out_mode_reference, dwidth_factor) * number_of_channels-1 downto 0);
rx_errdetect : out std_logic_vector(get_rx_dwidth_factor(use_generic_fifo,
clk_out_mode_reference, dwidth_factor) * number_of_channels-1 downto 0);
rx_disperr : out std_logic_vector(get_rx_dwidth_factor(use_generic_fifo,
clk_out_mode_reference, dwidth_factor) * number_of_channels-1 downto 0);
rx_signaldetect : out std_logic_vector(number_of_channels-1 downto 0);
rx_fifoalmostempty : out std_logic_vector(number_of_channels-1 downto 0);
rx_fifoalmostfull : out std_logic_vector(number_of_channels-1 downto 0);
rx_channelaligned : out std_logic_vector(number_of_quads-1 downto 0);
rx_bisterr : out std_logic_vector(number_of_channels-1 downto 0);
rx_bistdone : out std_logic_vector(number_of_channels-1 downto 0);
rx_a1a2sizeout : out std_logic_vector(get_rx_dwidth_factor(use_generic_fifo,
clk_out_mode_reference, dwidth_factor) * number_of_channels-1 downto 0);
tx_out : out std_logic_vector(number_of_channels-1 downto 0)
);
end component;
end;
package body stratixgx_mf_components is
function get_rx_channel_width(use_generic_fifo, clk_out_mode_reference : string;
channel_width : integer) return integer is
variable rx_channel_width : integer;
begin
rx_channel_width := channel_width;
if ((use_generic_fifo = "ON") or (clk_out_mode_reference = "OFF")) then
if (channel_width = 16) or (channel_width = 20) then
rx_channel_width := channel_width/2;
end if;
end if;
return rx_channel_width;
end get_rx_channel_width;
function get_rx_dwidth_factor(use_generic_fifo, clk_out_mode_reference : string;
dwidth_factor : integer) return integer is
variable rx_dwidth_factor : integer;
begin
rx_dwidth_factor := dwidth_factor;
if ((use_generic_fifo = "ON") or (clk_out_mode_reference = "OFF")) then
if (dwidth_factor = 2) then
rx_dwidth_factor := dwidth_factor/2;
end if;
end if;
return rx_dwidth_factor;
end get_rx_dwidth_factor;
end;
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,847 @@
-- Copyright (C) 1991-2015 Altera Corporation. All rights reserved.
-- Your use of Altera Corporation's design tools, logic functions
-- and other software and tools, and its AMPP partner logic
-- functions, and any output files from any of the foregoing
-- (including device programming or simulation files), and any
-- associated documentation or information are expressly subject
-- to the terms and conditions of the Altera Program License
-- Subscription Agreement, the Altera Quartus II License Agreement,
-- the Altera MegaCore Function License Agreement, or other
-- applicable license agreement, including, without limitation,
-- that your use is for the sole purpose of programming logic
-- devices manufactured by Altera and sold by Altera or its
-- authorized distributors. Please refer to the applicable
-- agreement for further details.
-- Quartus II 15.0.0 Build 145 04/22/2015
LIBRARY IEEE;
use IEEE.STD_LOGIC_1164.all;
use IEEE.VITAL_Timing.all;
use work.cycloneive_atom_pack.all;
package cycloneive_components is
--
-- cycloneive_lcell_comb
--
COMPONENT cycloneive_lcell_comb
generic (
lut_mask : std_logic_vector(15 downto 0) := (OTHERS => '1');
sum_lutc_input : string := "datac";
dont_touch : string := "off";
lpm_type : string := "cycloneive_lcell_comb";
TimingChecksOn: Boolean := True;
MsgOn: Boolean := DefGlitchMsgOn;
XOn: Boolean := DefGlitchXOn;
MsgOnChecks: Boolean := DefMsgOnChecks;
XOnChecks: Boolean := DefXOnChecks;
InstancePath: STRING := "*";
tpd_dataa_combout : VitalDelayType01 := DefPropDelay01;
tpd_datab_combout : VitalDelayType01 := DefPropDelay01;
tpd_datac_combout : VitalDelayType01 := DefPropDelay01;
tpd_datad_combout : VitalDelayType01 := DefPropDelay01;
tpd_cin_combout : VitalDelayType01 := DefPropDelay01;
tpd_dataa_cout : VitalDelayType01 := DefPropDelay01;
tpd_datab_cout : VitalDelayType01 := DefPropDelay01;
tpd_datac_cout : VitalDelayType01 := DefPropDelay01;
tpd_datad_cout : VitalDelayType01 := DefPropDelay01;
tpd_cin_cout : VitalDelayType01 := DefPropDelay01;
tipd_dataa : VitalDelayType01 := DefPropDelay01;
tipd_datab : VitalDelayType01 := DefPropDelay01;
tipd_datac : VitalDelayType01 := DefPropDelay01;
tipd_datad : VitalDelayType01 := DefPropDelay01;
tipd_cin : VitalDelayType01 := DefPropDelay01
);
port (
dataa : in std_logic := '1';
datab : in std_logic := '1';
datac : in std_logic := '1';
datad : in std_logic := '1';
cin : in std_logic := '0';
combout : out std_logic;
cout : out std_logic
);
END COMPONENT;
--
-- cycloneive_routing_wire
--
COMPONENT cycloneive_routing_wire
generic (
MsgOn : Boolean := DefGlitchMsgOn;
XOn : Boolean := DefGlitchXOn;
tpd_datain_dataout : VitalDelayType01 := DefPropDelay01;
tpd_datainglitch_dataout : VitalDelayType01 := DefPropDelay01;
tipd_datain : VitalDelayType01 := DefPropDelay01
);
PORT (
datain : in std_logic;
dataout : out std_logic
);
END COMPONENT;
--
-- cycloneive_pll
--
COMPONENT cycloneive_pll
GENERIC (
operation_mode : string := "normal";
pll_type : string := "auto"; -- AUTO/FAST/ENHANCED/LEFT_RIGHT/TOP_BOTTOM
compensate_clock : string := "clock0";
inclk0_input_frequency : integer := 0;
inclk1_input_frequency : integer := 0;
self_reset_on_loss_lock : string := "off";
switch_over_type : string := "auto";
switch_over_counter : integer := 1;
enable_switch_over_counter : string := "off";
bandwidth : integer := 0;
bandwidth_type : string := "auto";
use_dc_coupling : string := "false";
lock_c : integer := 4;
sim_gate_lock_device_behavior : string := "off";
lock_high : integer := 0;
lock_low : integer := 0;
lock_window_ui : string := "0.05";
lock_window : time := 5 ps;
test_bypass_lock_detect : string := "off";
clk0_output_frequency : integer := 0;
clk0_multiply_by : integer := 0;
clk0_divide_by : integer := 0;
clk0_phase_shift : string := "0";
clk0_duty_cycle : integer := 50;
clk1_output_frequency : integer := 0;
clk1_multiply_by : integer := 0;
clk1_divide_by : integer := 0;
clk1_phase_shift : string := "0";
clk1_duty_cycle : integer := 50;
clk2_output_frequency : integer := 0;
clk2_multiply_by : integer := 0;
clk2_divide_by : integer := 0;
clk2_phase_shift : string := "0";
clk2_duty_cycle : integer := 50;
clk3_output_frequency : integer := 0;
clk3_multiply_by : integer := 0;
clk3_divide_by : integer := 0;
clk3_phase_shift : string := "0";
clk3_duty_cycle : integer := 50;
clk4_output_frequency : integer := 0;
clk4_multiply_by : integer := 0;
clk4_divide_by : integer := 0;
clk4_phase_shift : string := "0";
clk4_duty_cycle : integer := 50;
pfd_min : integer := 0;
pfd_max : integer := 0;
vco_min : integer := 0;
vco_max : integer := 0;
vco_center : integer := 0;
m_initial : integer := 1;
m : integer := 0;
n : integer := 1;
c0_high : integer := 1;
c0_low : integer := 1;
c0_initial : integer := 1;
c0_mode : string := "bypass";
c0_ph : integer := 0;
c1_high : integer := 1;
c1_low : integer := 1;
c1_initial : integer := 1;
c1_mode : string := "bypass";
c1_ph : integer := 0;
c2_high : integer := 1;
c2_low : integer := 1;
c2_initial : integer := 1;
c2_mode : string := "bypass";
c2_ph : integer := 0;
c3_high : integer := 1;
c3_low : integer := 1;
c3_initial : integer := 1;
c3_mode : string := "bypass";
c3_ph : integer := 0;
c4_high : integer := 1;
c4_low : integer := 1;
c4_initial : integer := 1;
c4_mode : string := "bypass";
c4_ph : integer := 0;
m_ph : integer := 0;
clk0_counter : string := "unused";
clk1_counter : string := "unused";
clk2_counter : string := "unused";
clk3_counter : string := "unused";
clk4_counter : string := "unused";
c1_use_casc_in : string := "off";
c2_use_casc_in : string := "off";
c3_use_casc_in : string := "off";
c4_use_casc_in : string := "off";
m_test_source : integer := -1;
c0_test_source : integer := -1;
c1_test_source : integer := -1;
c2_test_source : integer := -1;
c3_test_source : integer := -1;
c4_test_source : integer := -1;
vco_multiply_by : integer := 0;
vco_divide_by : integer := 0;
vco_post_scale : integer := 1;
vco_frequency_control : string := "auto";
vco_phase_shift_step : integer := 0;
charge_pump_current : integer := 10;
loop_filter_r : string := " 1.0";
loop_filter_c : integer := 0;
pll_compensation_delay : integer := 0;
simulation_type : string := "functional";
lpm_type : string := "cycloneive_pll";
clk0_use_even_counter_mode : string := "off";
clk1_use_even_counter_mode : string := "off";
clk2_use_even_counter_mode : string := "off";
clk3_use_even_counter_mode : string := "off";
clk4_use_even_counter_mode : string := "off";
clk0_use_even_counter_value : string := "off";
clk1_use_even_counter_value : string := "off";
clk2_use_even_counter_value : string := "off";
clk3_use_even_counter_value : string := "off";
clk4_use_even_counter_value : string := "off";
init_block_reset_a_count : integer := 1;
init_block_reset_b_count : integer := 1;
charge_pump_current_bits : integer := 0;
lock_window_ui_bits : integer := 0;
loop_filter_c_bits : integer := 0;
loop_filter_r_bits : integer := 0;
test_counter_c0_delay_chain_bits : integer := 0;
test_counter_c1_delay_chain_bits : integer := 0;
test_counter_c2_delay_chain_bits : integer := 0;
test_counter_c3_delay_chain_bits : integer := 0;
test_counter_c4_delay_chain_bits : integer := 0;
test_counter_c5_delay_chain_bits : integer := 0;
test_counter_m_delay_chain_bits : integer := 0;
test_counter_n_delay_chain_bits : integer := 0;
test_feedback_comp_delay_chain_bits : integer := 0;
test_input_comp_delay_chain_bits : integer := 0;
test_volt_reg_output_mode_bits : integer := 0;
test_volt_reg_output_voltage_bits : integer := 0;
test_volt_reg_test_mode : string := "false";
vco_range_detector_high_bits : integer := -1;
vco_range_detector_low_bits : integer := -1;
scan_chain_mif_file : string := "";
auto_settings : string := "true";
family_name : string := "Cycloneive";
XOn : Boolean := DefGlitchXOn;
MsgOn : Boolean := DefGlitchMsgOn;
MsgOnChecks : Boolean := DefMsgOnChecks;
XOnChecks : Boolean := DefXOnChecks;
TimingChecksOn : Boolean := true;
InstancePath : STRING := "*";
tipd_inclk : VitalDelayArrayType01(1 downto 0) := (OTHERS => DefPropDelay01);
tipd_ena : VitalDelayType01 := DefPropDelay01;
tipd_pfdena : VitalDelayType01 := DefPropDelay01;
tipd_areset : VitalDelayType01 := DefPropDelay01;
tipd_fbin : VitalDelayType01 := DefPropDelay01;
tipd_scanclk : VitalDelayType01 := DefPropDelay01;
tipd_scanclkena : VitalDelayType01 := DefPropDelay01;
tipd_scandata : VitalDelayType01 := DefPropDelay01;
tipd_configupdate : VitalDelayType01 := DefPropDelay01;
tipd_clkswitch : VitalDelayType01 := DefPropDelay01;
tipd_phaseupdown : VitalDelayType01 := DefPropDelay01;
tipd_phasecounterselect : VitalDelayArrayType01(2 DOWNTO 0) := (OTHERS => DefPropDelay01);
tipd_phasestep : VitalDelayType01 := DefPropDelay01;
tsetup_scandata_scanclk_noedge_negedge : VitalDelayType := DefSetupHoldCnst;
thold_scandata_scanclk_noedge_negedge : VitalDelayType := DefSetupHoldCnst;
tsetup_scanclkena_scanclk_noedge_negedge : VitalDelayType := DefSetupHoldCnst;
thold_scanclkena_scanclk_noedge_negedge : VitalDelayType := DefSetupHoldCnst;
use_vco_bypass : string := "false"
);
PORT
(
inclk : in std_logic_vector(1 downto 0);
fbin : in std_logic := '0';
fbout : out std_logic;
clkswitch : in std_logic := '0';
areset : in std_logic := '0';
pfdena : in std_logic := '1';
scandata : in std_logic := '0';
scanclk : in std_logic := '0';
scanclkena : in std_logic := '1';
configupdate : in std_logic := '0';
clk : out std_logic_vector(4 downto 0);
phasecounterselect : in std_logic_vector(2 downto 0) := "000";
phaseupdown : in std_logic := '0';
phasestep : in std_logic := '0';
clkbad : out std_logic_vector(1 downto 0);
activeclock : out std_logic;
locked : out std_logic;
scandataout : out std_logic;
scandone : out std_logic;
phasedone : out std_logic;
vcooverrange : out std_logic;
vcounderrange : out std_logic
);
END COMPONENT;
--
-- cycloneive_ff
--
COMPONENT cycloneive_ff
generic (
power_up : string := "low";
x_on_violation : string := "on";
lpm_type : string := "cycloneive_ff";
tsetup_d_clk_noedge_posedge : VitalDelayType := DefSetupHoldCnst;
tsetup_asdata_clk_noedge_posedge : VitalDelayType := DefSetupHoldCnst;
tsetup_sclr_clk_noedge_posedge : VitalDelayType := DefSetupHoldCnst;
tsetup_sload_clk_noedge_posedge : VitalDelayType := DefSetupHoldCnst;
tsetup_ena_clk_noedge_posedge : VitalDelayType := DefSetupHoldCnst;
thold_d_clk_noedge_posedge : VitalDelayType := DefSetupHoldCnst;
thold_asdata_clk_noedge_posedge : VitalDelayType := DefSetupHoldCnst;
thold_sclr_clk_noedge_posedge : VitalDelayType := DefSetupHoldCnst;
thold_sload_clk_noedge_posedge : VitalDelayType := DefSetupHoldCnst;
thold_ena_clk_noedge_posedge : VitalDelayType := DefSetupHoldCnst;
tpd_clk_q_posedge : VitalDelayType01 := DefPropDelay01;
tpd_clrn_q_posedge : VitalDelayType01 := DefPropDelay01;
tpd_aload_q_posedge : VitalDelayType01 := DefPropDelay01;
tpd_asdata_q: VitalDelayType01 := DefPropDelay01;
tipd_clk : VitalDelayType01 := DefPropDelay01;
tipd_d : VitalDelayType01 := DefPropDelay01;
tipd_asdata : VitalDelayType01 := DefPropDelay01;
tipd_sclr : VitalDelayType01 := DefPropDelay01;
tipd_sload : VitalDelayType01 := DefPropDelay01;
tipd_clrn : VitalDelayType01 := DefPropDelay01;
tipd_aload : VitalDelayType01 := DefPropDelay01;
tipd_ena : VitalDelayType01 := DefPropDelay01;
TimingChecksOn: Boolean := True;
MsgOn: Boolean := DefGlitchMsgOn;
XOn: Boolean := DefGlitchXOn;
MsgOnChecks: Boolean := DefMsgOnChecks;
XOnChecks: Boolean := DefXOnChecks;
InstancePath: STRING := "*"
);
port (
d : in std_logic := '0';
clk : in std_logic := '0';
clrn : in std_logic := '1';
aload : in std_logic := '0';
sclr : in std_logic := '0';
sload : in std_logic := '0';
ena : in std_logic := '1';
asdata : in std_logic := '0';
devclrn : in std_logic := '1';
devpor : in std_logic := '1';
q : out std_logic
);
END COMPONENT;
--
-- cycloneive_ram_block
--
COMPONENT cycloneive_ram_block
GENERIC (
operation_mode : STRING := "single_port";
mixed_port_feed_through_mode : STRING := "dont_care";
ram_block_type : STRING := "auto";
logical_ram_name : STRING := "ram_name";
init_file : STRING := "init_file.hex";
init_file_layout : STRING := "none";
data_interleave_width_in_bits : INTEGER := 1;
data_interleave_offset_in_bits : INTEGER := 1;
port_a_logical_ram_depth : INTEGER := 0;
port_a_logical_ram_width : INTEGER := 0;
port_a_first_address : INTEGER := 0;
port_a_last_address : INTEGER := 0;
port_a_first_bit_number : INTEGER := 0;
port_a_address_clear : STRING := "none";
port_a_data_out_clear : STRING := "none";
port_a_data_in_clock : STRING := "clock0";
port_a_address_clock : STRING := "clock0";
port_a_write_enable_clock : STRING := "clock0";
port_a_read_enable_clock : STRING := "clock0";
port_a_byte_enable_clock : STRING := "clock0";
port_a_data_out_clock : STRING := "none";
port_a_data_width : INTEGER := 1;
port_a_address_width : INTEGER := 1;
port_a_byte_enable_mask_width : INTEGER := 1;
port_b_logical_ram_depth : INTEGER := 0;
port_b_logical_ram_width : INTEGER := 0;
port_b_first_address : INTEGER := 0;
port_b_last_address : INTEGER := 0;
port_b_first_bit_number : INTEGER := 0;
port_b_address_clear : STRING := "none";
port_b_data_out_clear : STRING := "none";
port_b_data_in_clock : STRING := "clock1";
port_b_address_clock : STRING := "clock1";
port_b_write_enable_clock: STRING := "clock1";
port_b_read_enable_clock: STRING := "clock1";
port_b_byte_enable_clock : STRING := "clock1";
port_b_data_out_clock : STRING := "none";
port_b_data_width : INTEGER := 1;
port_b_address_width : INTEGER := 1;
port_b_byte_enable_mask_width : INTEGER := 1;
port_a_read_during_write_mode : STRING := "new_data_no_nbe_read";
port_b_read_during_write_mode : STRING := "new_data_no_nbe_read";
power_up_uninitialized : STRING := "false";
port_b_byte_size : INTEGER := 0;
port_a_byte_size : INTEGER := 0;
safe_write : STRING := "err_on_2clk";
init_file_restructured : STRING := "unused";
lpm_type : string := "cycloneive_ram_block";
lpm_hint : string := "true";
clk0_input_clock_enable : STRING := "none"; -- ena0,ena2,none
clk0_core_clock_enable : STRING := "none"; -- ena0,ena2,none
clk0_output_clock_enable : STRING := "none"; -- ena0,none
clk1_input_clock_enable : STRING := "none"; -- ena1,ena3,none
clk1_core_clock_enable : STRING := "none"; -- ena1,ena3,none
clk1_output_clock_enable : STRING := "none"; -- ena1,none
mem_init0 : BIT_VECTOR := X"0";
mem_init1 : BIT_VECTOR := X"0";
mem_init2 : BIT_VECTOR := X"0";
mem_init3 : BIT_VECTOR := X"0";
mem_init4 : BIT_VECTOR := X"0";
connectivity_checking : string := "off"
);
PORT (
portadatain : IN STD_LOGIC_VECTOR(port_a_data_width - 1 DOWNTO 0) := (OTHERS => '0');
portaaddr : IN STD_LOGIC_VECTOR(port_a_address_width - 1 DOWNTO 0) := (OTHERS => '0');
portawe : IN STD_LOGIC := '0';
portare : IN STD_LOGIC := '1';
portbdatain : IN STD_LOGIC_VECTOR(port_b_data_width - 1 DOWNTO 0) := (OTHERS => '0');
portbaddr : IN STD_LOGIC_VECTOR(port_b_address_width - 1 DOWNTO 0) := (OTHERS => '0');
portbwe : IN STD_LOGIC := '0';
portbre : IN STD_LOGIC := '1';
clk0 : IN STD_LOGIC := '0';
clk1 : IN STD_LOGIC := '0';
ena0 : IN STD_LOGIC := '1';
ena1 : IN STD_LOGIC := '1';
ena2 : IN STD_LOGIC := '1';
ena3 : IN STD_LOGIC := '1';
clr0 : IN STD_LOGIC := '0';
clr1 : IN STD_LOGIC := '0';
portabyteenamasks : IN STD_LOGIC_VECTOR(port_a_byte_enable_mask_width - 1 DOWNTO 0) := (OTHERS => '1');
portbbyteenamasks : IN STD_LOGIC_VECTOR(port_b_byte_enable_mask_width - 1 DOWNTO 0) := (OTHERS => '1');
devclrn : IN STD_LOGIC := '1';
devpor : IN STD_LOGIC := '1';
portaaddrstall : IN STD_LOGIC := '0';
portbaddrstall : IN STD_LOGIC := '0';
portadataout : OUT STD_LOGIC_VECTOR(port_a_data_width - 1 DOWNTO 0);
portbdataout : OUT STD_LOGIC_VECTOR(port_b_data_width - 1 DOWNTO 0)
);
END COMPONENT;
--
-- cycloneive_mac_mult
--
COMPONENT cycloneive_mac_mult
GENERIC (
dataa_width : integer := 18;
datab_width : integer := 18;
dataa_clock : string := "none";
datab_clock : string := "none";
signa_clock : string := "none";
signb_clock : string := "none";
TimingChecksOn : Boolean := True;
MsgOn : Boolean := DefGlitchMsgOn;
XOn : Boolean := DefGlitchXOn;
MsgOnChecks : Boolean := DefMsgOnChecks;
XOnChecks : Boolean := DefXOnChecks;
InstancePath : STRING := "*";
lpm_hint : string := "true";
lpm_type : string := "cycloneive_mac_mult"
);
PORT (
dataa : IN std_logic_vector(dataa_width-1 DOWNTO 0) := (OTHERS => '0');
datab : IN std_logic_vector(datab_width-1 DOWNTO 0) := (OTHERS => '0');
signa : IN std_logic := '1';
signb : IN std_logic := '1';
clk : IN std_logic := '0';
aclr : IN std_logic := '0';
ena : IN std_logic := '0';
dataout : OUT std_logic_vector((dataa_width+datab_width)-1 DOWNTO 0);
devclrn : IN std_logic := '1';
devpor : IN std_logic := '1'
);
END COMPONENT;
--
-- cycloneive_mac_out
--
COMPONENT cycloneive_mac_out
GENERIC (
dataa_width : integer := 1;
output_clock : string := "none";
TimingChecksOn : Boolean := True;
MsgOn : Boolean := DefGlitchMsgOn;
XOn : Boolean := DefGlitchXOn;
MsgOnChecks : Boolean := DefMsgOnChecks;
XOnChecks : Boolean := DefXOnChecks;
InstancePath : STRING := "*";
tipd_dataa : VitalDelayArrayType01(35 downto 0)
:= (OTHERS => DefPropDelay01);
tipd_clk : VitalDelayType01 := DefPropDelay01;
tipd_ena : VitalDelayType01 := DefPropDelay01;
tipd_aclr : VitalDelayType01 := DefPropDelay01;
tpd_dataa_dataout :VitalDelayArrayType01(36*36 -1 downto 0) :=(others => DefPropDelay01);
tpd_aclr_dataout_posedge : VitalDelayArrayType01(35 downto 0) :=(others => DefPropDelay01);
tpd_clk_dataout_posedge :VitalDelayArrayType01(35 downto 0) :=(others => DefPropDelay01);
tsetup_dataa_clk_noedge_posedge : VitalDelayArrayType(35 downto 0) := (OTHERS => DefSetupHoldCnst);
thold_dataa_clk_noedge_posedge : VitalDelayArrayType(35 downto 0) := (OTHERS => DefSetupHoldCnst);
tsetup_ena_clk_noedge_posedge : VitalDelayType := DefSetupHoldCnst;
thold_ena_clk_noedge_posedge : VitalDelayType := DefSetupHoldCnst;
lpm_hint : string := "true";
lpm_type : string := "cycloneive_mac_out");
PORT (
dataa : IN std_logic_vector(dataa_width-1 DOWNTO 0) := (OTHERS => '0');
clk : IN std_logic := '0';
aclr : IN std_logic := '0';
ena : IN std_logic := '1';
dataout : OUT std_logic_vector(dataa_width-1 DOWNTO 0);
devclrn : IN std_logic := '1';
devpor : IN std_logic := '1'
);
END COMPONENT;
--
-- cycloneive_io_ibuf
--
COMPONENT cycloneive_io_ibuf
GENERIC (
tipd_i : VitalDelayType01 := DefPropDelay01;
tipd_ibar : VitalDelayType01 := DefPropDelay01;
tpd_i_o : VitalDelayType01 := DefPropDelay01;
tpd_ibar_o : VitalDelayType01 := DefPropDelay01;
XOn : Boolean := DefGlitchXOn;
MsgOn : Boolean := DefGlitchMsgOn;
differential_mode : string := "false";
bus_hold : string := "false";
simulate_z_as : string := "Z";
lpm_type : string := "cycloneive_io_ibuf"
);
PORT (
i : IN std_logic := '0';
ibar : IN std_logic := '0';
o : OUT std_logic
);
END COMPONENT;
--
-- cycloneive_io_obuf
--
COMPONENT cycloneive_io_obuf
GENERIC (
tipd_i : VitalDelayType01 := DefPropDelay01;
tipd_oe : VitalDelayType01 := DefPropDelay01;
tipd_seriesterminationcontrol : VitalDelayArrayType01(15 DOWNTO 0) := (others => DefPropDelay01 );
tpd_i_o : VitalDelayType01 := DefPropDelay01;
tpd_oe_o : VitalDelayType01 := DefPropDelay01;
tpd_i_obar : VitalDelayType01 := DefPropDelay01;
tpd_oe_obar : VitalDelayType01 := DefPropDelay01;
XOn : Boolean := DefGlitchXOn;
MsgOn : Boolean := DefGlitchMsgOn;
open_drain_output : string := "false";
bus_hold : string := "false";
lpm_type : string := "cycloneive_io_obuf"
);
PORT (
i : IN std_logic := '0';
oe : IN std_logic := '1';
seriesterminationcontrol : IN std_logic_vector(15 DOWNTO 0) := (others => '0');
devoe : IN std_logic := '1';
o : OUT std_logic;
obar : OUT std_logic
);
END COMPONENT;
--
-- cycloneive_ddio_oe
--
COMPONENT cycloneive_ddio_oe
generic(
tipd_oe : VitalDelayType01 := DefPropDelay01;
tipd_clk : VitalDelayType01 := DefPropDelay01;
tipd_ena : VitalDelayType01 := DefPropDelay01;
tipd_areset : VitalDelayType01 := DefPropDelay01;
tipd_sreset : VitalDelayType01 := DefPropDelay01;
XOn : Boolean := DefGlitchXOn;
MsgOn : Boolean := DefGlitchMsgOn;
power_up : string := "low";
async_mode : string := "none";
sync_mode : string := "none";
lpm_type : string := "cycloneive_ddio_oe"
);
PORT (
oe : IN std_logic := '1';
clk : IN std_logic := '0';
ena : IN std_logic := '1';
areset : IN std_logic := '0';
sreset : IN std_logic := '0';
dataout : OUT std_logic;
dfflo : OUT std_logic;
dffhi : OUT std_logic;
devclrn : IN std_logic := '1';
devpor : IN std_logic := '1'
);
END COMPONENT;
--
-- cycloneive_ddio_out
--
COMPONENT cycloneive_ddio_out
generic(
tipd_datainlo : VitalDelayType01 := DefPropDelay01;
tipd_datainhi : VitalDelayType01 := DefPropDelay01;
tipd_clk : VitalDelayType01 := DefPropDelay01;
tipd_clkhi : VitalDelayType01 := DefPropDelay01;
tipd_clklo : VitalDelayType01 := DefPropDelay01;
tipd_muxsel : VitalDelayType01 := DefPropDelay01;
tipd_ena : VitalDelayType01 := DefPropDelay01;
tipd_areset : VitalDelayType01 := DefPropDelay01;
tipd_sreset : VitalDelayType01 := DefPropDelay01;
XOn : Boolean := DefGlitchXOn;
MsgOn : Boolean := DefGlitchMsgOn;
power_up : string := "low";
async_mode : string := "none";
sync_mode : string := "none";
use_new_clocking_model : string := "false";
lpm_type : string := "cycloneive_ddio_out"
);
PORT (
datainlo : IN std_logic := '0';
datainhi : IN std_logic := '0';
clk : IN std_logic := '0';
clkhi : IN std_logic := '0';
clklo : IN std_logic := '0';
muxsel : IN std_logic := '0';
ena : IN std_logic := '1';
areset : IN std_logic := '0';
sreset : IN std_logic := '0';
dataout : OUT std_logic;
dfflo : OUT std_logic;
dffhi : OUT std_logic ;
devclrn : IN std_logic := '1';
devpor : IN std_logic := '1'
);
END COMPONENT;
--
-- cycloneive_pseudo_diff_out
--
COMPONENT cycloneive_pseudo_diff_out
GENERIC (
tipd_i : VitalDelayType01 := DefPropDelay01;
tpd_i_o : VitalDelayType01 := DefPropDelay01;
tpd_i_obar : VitalDelayType01 := DefPropDelay01;
XOn : Boolean := DefGlitchXOn;
MsgOn : Boolean := DefGlitchMsgOn;
lpm_type : string := "cycloneive_pseudo_diff_out"
);
PORT (
i : IN std_logic := '0';
o : OUT std_logic;
obar : OUT std_logic
);
END COMPONENT;
--
-- cycloneive_io_pad
--
COMPONENT cycloneive_io_pad
GENERIC (
lpm_type : string := "cycloneive_io_pad");
PORT (
padin : IN std_logic := '0'; -- Input Pad
padout : OUT std_logic); -- Output Pad
END COMPONENT;
--
-- cycloneive_asmiblock
--
COMPONENT cycloneive_asmiblock
generic (
lpm_type : string := "cycloneive_asmiblock";
enable_sim : string := "false"
);
port (
dclkin : in std_logic;
scein : in std_logic;
oe : in std_logic;
sdoin : in std_logic;
data0out: out std_logic
);
END COMPONENT;
--
-- cycloneive_clkctrl
--
COMPONENT cycloneive_clkctrl
generic (
clock_type : STRING := "Auto";
lpm_type : STRING := "cycloneive_clkctrl";
ena_register_mode : STRING := "Falling Edge";
TimingChecksOn : Boolean := True;
MsgOn : Boolean := DefGlitchMsgOn;
XOn : Boolean := DefGlitchXOn;
MsgOnChecks : Boolean := DefMsgOnChecks;
XOnChecks : Boolean := DefXOnChecks;
InstancePath : STRING := "*";
tpd_inclk_outclk : VitalDelayArrayType01(3 downto 0) := (OTHERS => DefPropDelay01);
tipd_inclk : VitalDelayArrayType01(3 downto 0) := (OTHERS => DefPropDelay01);
tipd_clkselect : VitalDelayArrayType01(1 downto 0) := (OTHERS => DefPropDelay01);
tipd_ena : VitalDelayType01 := DefPropDelay01
);
port (
inclk : in std_logic_vector(3 downto 0) := "0000";
clkselect : in std_logic_vector(1 downto 0) := "00";
ena : in std_logic := '1';
devclrn : in std_logic := '1';
devpor : in std_logic := '1';
outclk : out std_logic
);
END COMPONENT;
--
-- cycloneive_rublock
--
COMPONENT cycloneive_rublock
generic
(
sim_init_config : string := "factory";
sim_init_watchdog_value : integer := 0;
sim_init_status : integer := 0;
lpm_type : string := "cycloneive_rublock"
);
port
(
clk : in std_logic;
shiftnld : in std_logic;
captnupdt : in std_logic;
regin : in std_logic;
rsttimer : in std_logic;
rconfig : in std_logic;
regout : out std_logic
);
END COMPONENT;
--
-- cycloneive_apfcontroller
--
COMPONENT cycloneive_apfcontroller
generic
(
lpm_type: string := "cycloneive_apfcontroller"
);
port
(
usermode : out std_logic;
nceout : out std_logic
);
END COMPONENT;
--
-- cycloneive_termination
--
COMPONENT cycloneive_termination
GENERIC (
pullup_control_to_core: string := "false";
power_down : string := "true";
test_mode : string := "false";
left_shift_termination_code : string := "false";
pullup_adder : integer := 0;
pulldown_adder : integer := 0;
clock_divide_by : integer := 32; -- 1, 4, 32
runtime_control : string := "false";
shift_vref_rup : string := "true";
shift_vref_rdn : string := "true";
shifted_vref_control : string := "true";
lpm_type : string := "cycloneive_termination");
PORT (
rup : IN std_logic := '0';
rdn : IN std_logic := '0';
terminationclock : IN std_logic := '0';
terminationclear : IN std_logic := '0';
devpor : IN std_logic := '1';
devclrn : IN std_logic := '1';
comparatorprobe : OUT std_logic;
terminationcontrolprobe : OUT std_logic;
calibrationdone : OUT std_logic;
terminationcontrol : OUT std_logic_vector(15 DOWNTO 0));
END COMPONENT;
--
-- cycloneive_jtag
--
COMPONENT cycloneive_jtag
generic (
lpm_type : string := "cycloneive_jtag"
);
port (
tms : in std_logic := '0';
tck : in std_logic := '0';
tdi : in std_logic := '0';
tdoutap : in std_logic := '0';
tdouser : in std_logic := '0';
tdo: out std_logic;
tmsutap: out std_logic;
tckutap: out std_logic;
tdiutap: out std_logic;
shiftuser: out std_logic;
clkdruser: out std_logic;
updateuser: out std_logic;
runidleuser: out std_logic;
usr1user: out std_logic
);
END COMPONENT;
--
-- cycloneive_crcblock
--
COMPONENT cycloneive_crcblock
generic (
oscillator_divider : integer := 1;
lpm_type : string := "cycloneive_crcblock"
);
port (
clk : in std_logic := '0';
shiftnld : in std_logic := '0';
ldsrc : in std_logic := '0';
crcerror : out std_logic;
regout : out std_logic
);
END COMPONENT;
--
-- cycloneive_oscillator
--
COMPONENT cycloneive_oscillator
generic
(
lpm_type: string := "cycloneive_oscillator";
TimingChecksOn: Boolean := True;
XOn: Boolean := DefGlitchXOn;
MsgOn: Boolean := DefGlitchMsgOn;
tpd_oscena_clkout_posedge : VitalDelayType01 := DefPropDelay01;
tipd_oscena : VitalDelayType01 := DefPropDelay01
);
port
(
oscena : in std_logic;
clkout : out std_logic
);
END COMPONENT;
end cycloneive_components;
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
+34
View File
@@ -0,0 +1,34 @@
if {![file exists build]} {mkdir build}
cd build
if {![file exists altera]} {mkdir altera}
cd altera
if {[file exists altera]} {vdel -lib altera -all}
vlib altera
vcom -93 -work altera ../../altera/libsrc/altera/altera_primitives_components.vhd
vcom -93 -work altera ../../altera/libsrc/altera/altera_primitives.vhd
vcom -93 -work altera ../../altera/libsrc/altera/altera_internal_syn.vhd
vcom -93 -work altera ../../altera/libsrc/altera/altera_europa_support_lib.vhd
vcom -93 -work altera ../../altera/libsrc/altera/altera_standard_functions.vhd
vcom -93 -work altera ../../altera/libsrc/altera/altera_syn_attributes.vhd
vlib altera_mf
vcom -93 -work altera_mf ../../altera/libsrc/altera_mf/altera_mf_components.vhd
vcom -93 -work altera_mf ../../altera/libsrc/altera_mf/altera_mf.vhd
vlib cycloneive
vcom -93 -work cycloneive ../../altera/libsrc/cycloneive/cycloneive_atoms.vhd
vcom -93 -work cycloneive ../../altera/libsrc/cycloneive/cycloneive_components.vhd
vlib altera_lnsim
vcom -93 -work altera_lnsim ../../altera/libsrc/altera_lnsim/altera_lnsim_components.vhd
vlib cyclonev
vcom -93 -work cyclonev ../../altera/libsrc/cyclonev/cyclonev_atoms.vhd
vcom -93 -work cyclonev ../../altera/libsrc/cyclonev/cyclonev_components.vhd
cd ..
cd ..
-13
View File
@@ -1,13 +0,0 @@
#
# Compile script for Modeltech
#
vlib ieee_proposed
vmap ieee_proposedx ieee_proposed
vcom -work ieee_proposed -93 "../../lib/fixed/modelsim/standard_additions_c.vhdl"
vcom -work ieee_proposed -93 "../../lib/fixed/modelsim/env_c.vhdl"
vcom -work ieee_proposed -93 "../../lib/fixed/modelsim/standard_textio_additions_c.vhdl"
vcom -work ieee_proposed -93 "../../lib/fixed/modelsim/std_logic_1164_additions.vhdl"
vcom -work ieee_proposed -93 "../../lib/fixed/modelsim/numeric_std_additions.vhdl"
vcom -work ieee_proposed -93 "../../lib/fixed/modelsim/numeric_std_unsigned_c.vhdl"
vcom -work ieee_proposed -93 "../../lib/fixed/modelsim/math_utility_pkg_c.vhdl"
vcom -work ieee_proposed -93 "../../lib/fixed/modelsim/fixed_pkg_c.vhdl"
+22
View File
@@ -0,0 +1,22 @@
#
# Compile script for Modeltech
#
if {![file exists build]} {mkdir build}
cd build
if {![file exists modelsim]} {mkdir modelsim}
cd modelsim
if {[file exists modelsim]} {vdel -lib modelsim -all}
vlib ieee_proposed
vcom -work ieee_proposed ../../ieee_proposed/modelsim/standard_additions_c.vhdl
vcom -work ieee_proposed ../../ieee_proposed/modelsim/standard_textio_additions_c.vhdl
vcom -work ieee_proposed ../../ieee_proposed/modelsim/env_c.vhdl
vcom -work ieee_proposed ../../ieee_proposed/modelsim/std_logic_1164_additions.vhdl
vcom -work ieee_proposed ../../ieee_proposed/modelsim/numeric_std_additions.vhdl
vcom -work ieee_proposed ../../ieee_proposed/modelsim/numeric_std_unsigned_c.vhdl
vcom -work ieee_proposed ../../ieee_proposed/modelsim/fixed_float_types_c.vhdl
vcom -work ieee_proposed ../../ieee_proposed/modelsim/fixed_pkg_c.vhdl
vcom -work ieee_proposed ../../ieee_proposed/modelsim/float_pkg_c.vhdl
+3 -2
View File
@@ -1,6 +1,7 @@
vlib simprim
vlib build
vlib build/xilinx
set XILINX $env(XILINX)
vlib build/xilinx/simprim
vcom -93 -work simprim $XILINX/vhdl/src/simprims/simprim_Vcomponents_mti.vhd
vcom -93 -work simprim $XILINX/vhdl/src/simprims/simprim_Vpackage_mti.vhd
+12 -5
View File
@@ -1,8 +1,15 @@
if {![file exists build]} {mkdir build}
cd build
if {![file exists xilinx]} {mkdir xilinx}
cd xilinx
if {[file exists unisim]} {vdel -lib unisim -all}
vlib unisim
set XILINX $env(XILINX)
vcom -93 -work unisim ../../xilinx/libsrc/unisims/unisim_vpkg.vhd
vcom -93 -work unisim ../../xilinx/libsrc/unisims/unisim_vcomp.vhd
vcom -93 -work unisim ../../xilinx/libsrc/unisims/unisim_smodel.vhd
vcom -93 -work unisim ../../xilinx/libsrc/unisims/unisim_vital.vhd
vcom -93 -work unisim $XILINX/vhdl/src/unisims/unisim_vpkg.vhd
vcom -93 -work unisim $XILINX/vhdl/src/unisims/unisim_vcomp.vhd
vcom -93 -work unisim $XILINX/vhdl/src/unisims/unisim_smodel.vhd
vcom -93 -work unisim $XILINX/vhdl/src/unisims/unisim_vital.vhd
cd ..
cd ..
+28
View File
@@ -0,0 +1,28 @@
# -------------------------------------------------
# Compile script for GHDL
# -------------------------------------------------
include ../make/defs.mk
# -------------------------------------------------
# Global options
# -------------------------------------------------
LANG_STD := 93c
IEEE_STD := standard
WORK_LIB := ieee_proposed
TARGET := ieee_proposed
# -------------------------------------------------
# Target options
# -------------------------------------------------
SRCS := $(LIB_PATH)/standard_additions_c.vhdl
SRCS += $(LIB_PATH)/standard_textio_additions_c.vhdl
SRCS += $(LIB_PATH)/env_c.vhdl
SRCS += $(LIB_PATH)/std_logic_1164_additions.vhdl
SRCS += $(LIB_PATH)/numeric_std_additions.vhdl
SRCS += $(LIB_PATH)/numeric_std_unsigned_c.vhdl
SRCS += $(LIB_PATH)/fixed_float_types_c.vhdl
SRCS += $(LIB_PATH)/fixed_pkg_c.vhdl
SRCS += $(LIB_PATH)/float_pkg_c.vhdl
include ../make/ghdl.mk
+173
View File
@@ -0,0 +1,173 @@
This is the "ieee_proposed" library. This is a compatability library,
which is designed to provide all of the functionality of the VHDL-200X-FT
packages in VHDL-93. The "_c" after the package name is used to denote
that this is a 1993 compliant version of this package. Otherwise, the
name of the file and the name of the package are the same.
Please compile the following files into a library named "ieee_proposed":
standard_additions_c.vhdl
env_c.vhdl
standard_textio_additions_c.vhdl
std_logic_1164_additions.vhdl
numeric_std_additions.vhdl
numeric_std_unsigned_c.vhdl
fixed_pkg_c.vhdl
float_pkg_c.vhdl
New/Updated functions
A) standard_additions -- Additions to the package "std.standard"
Use model:
use ieee_proposed.standard_additions.all;
Dependancies: None.
Notes: The functions "rising_edge" and "falling_edge" are defined in
this package. If you use "numeric_bit" they are ALSO defined in that
package, causing a conflict. The VHDL-200X-FT version of numeric_bit
has these functions commented out, as well as the "sll", "srl", "ror"
and "rol" functions which are implicit.
New types defined in this package:
REAL_VECTOR
TIME_VECTOR
INTEGER_VECTOR
BOOLEAN_VECTOR
New constants defined in this package:
SIM_RESOLUTION : TIME - returns the simulator's resolution (1 ns default)
1) "maximum" and "minimum" are defined for all default datatypes
2) _reduce functions (and_reduce, nand_reduce, or_reduce ...) are defined
These functions reduce a bit_vector to a single bit. Example:
or_reduce ("0101") = '1'. In VHDL-2006 syntax these will be "or".
3) "vector" and "bit" operations are defined. These will perform a
boolean operation of a vector. Example:
"1" xor "1010" = "0101";
5) /??/ function is defined for "bit" ("??" operator is release)
if (/??/('1')) then -- will return a "true".
6) rising_edge and falling_edge functions are defined (see Notes).
7) to_string function - Converts any of the base types into a string.
Example:
assert (bv = "101") report "result was " & to_string(bv) severity note;
8) to_hstring and to_ostring function (bit_vector to hex or octal string)
B) standard_textio_additions - Additions to the package "std.textio"
Use model:
use ieee_proposed.standard_textio_additions.all;
Dependencies: std.textio, ieee_proposed.standard_additions
1) tee - Echos the string to BOTH the file and the screen
2) SREAD and SWRITE - String read and write routines (so you no longer
need to do write (L, string'("ABCEDFG"));
3) HREAD and HWRITE (Hex read and write) for bit_vector
4) OREAD and OWRITE (octal read and write) for bit_vector
5) BREAD and BWRITE (binary read and write, same as "READ" and "WRITE" for
bit_vector
6) justify - Justify a string left or right with a width. Example:
justify ("ABCD", left, 6); will result in "ABCD "
C) std_logic_1164_additions - Additions to the package "ieee.std_logic_1164"
Usage model:
use ieee.std_logic_1164.all;
-- use ieee.std_logic_textio.all; -- Comment out, included in "_additions".
use ieee_proposed.std_logic_1164_additions.all;
Dependencies: ieee.std_logic_1164
Note: The contents of the "std_logic_textio" package have now been
included in the "std_logic_1164" package, and an EMPTY "std_logic_textio"
package is provided in the new release.
1) Short had aliases:
a) to_bv - calls "to_BitVector"
b) to_slv - calls "to_StdLogicVector"
c) to_sulv - calls "to_stdULogicVector"
2) Long hand aliases:
a) to_bit_vector - calls "to_BitVector"
b) to_std_logic_vector - calls "to_StdLogicVector"
c) to_std_ulogic_vector - calls "to_StdULogicVector"
3) _reduce functions (and_reduce, nand_reduce, or_reduce ...) are defined
These functions reduce a std_logic_vector (or ulogic) to a single bit.
In vhdl-2006 these will be unary "or", example "or "11011" = '1'"
4) "vector" and "std_ulogic" operations are defined. These will perform a
boolean operation of a vector. Example:
"1" xor "1010" = "0101";
5) "std_ulogic" and "boolean" operations are defined. Thus:
if '1' and true then -- returns a "true".
6) "\??\" function is defined for "std_ulogic" ("??" operator is release)
if (bool('1')) then -- will return a "true".
7) READ and WRITE procedures for "std_logic_vector", "std_ulogic_vector"
and "std_ulogic" are defined.
8) HREAD and HWRITE (Hex read and write) for std_logic_vector
and std_ulogic_vector. These are more "forgiving" than the ones
originally from "std_logic_textio"
9) OREAD and OWRITE (octal read and write) for std_logic_vector
and std_ulogic_vector. These are more "forgiving" than the ones
originally from "std_logic_textio"
10) BREAD and BWRITE (binary read and write, same as "READ" and "WRITE" for
std_logic_vector and std_ulogic_vector.
11) to_string function - Converts a "std_ulogic", "std_logic_vector" or
"std_ulogic_vector" types into a string.
Example:
assert (slv = "101") report "result was " & to_string(slv) severity note;
12) to_hstring and to_ostring function (std_(u)logic_vector to hex or octal
string)
D) numeric_std_additions - additions the the package "ieee.numeric_std"
Usage Model:
use ieee.std_logic_1164.all;
use ieee.numeric_std.all;
use ieee_proposed.numeric_std_additions.all;
Dependencies: ieee.std_logic_1164, ieee.numeric_std
1) SIGNED or UNSIGNED + std_ulogic operators
2) SIGNED or UNSIGNED - std_ulogic operators
3) type UNRESOLVED_UNSIGNED (aliased to U_UNSIGNED) is an unresolved
verion of UNSIGNED. It is aliased to "UNSIGNED" for compatability.
4) type UNRESOLVED_SIGNED (aliased to U_SIGNED) is an unresolved
verion of SIGNED. It is aliased to "SIGNED" for compatability.
5) \?=\, \?/=\ - similar to "std_match", but return std_ulogic values.
\?<\, \?<=\, \?>\, \?>=\ - compare functions which retrun std_ulogic.
(these will be "?="... operators in the release)
7) To_X01, To_X01Z, To_U01X, Is_X - same as std_logic_1164 functions,
but overloaded for SIGNED and UNSIGNED.
8) "sla" and "sra" - Mathmetically correct versions of these functions.
9) minimum and maximum - smaller or larger of two SIGNED or UNSIGNED values.
10) find_rightmost and find_leftmost - finds the first bit in a string.
Example:
find_leftmost (c12, '1'); -- returns the Log2 of "c12".
returns -1 if not found.
11) _reduce functions (and_reduce, nand_reduce, or_reduce ...) are defined
These functions reduce a SIGNED or an UNSIGNED to a single bit.
(will overload the "or" and "and", ... operators in the release)
12) SIGNED or UNSIGNED and "std_ulogic" operations are defined.
These will perform a boolean operation of a vector. Example:
"1" xor "1010" = "0101";
13) READ and WRITE procedures for "SIGNED", and "UNSIGNED" are defined.
14) HREAD and HWRITE (Hex read and write) for SIGNED and UNSIGNED.
These are more "forgiving" than the ones
originally from "std_logic_textio"
15) OREAD and OWRITE (octal read and write) for "SIGNED" and "UNSIGNED.
These are more "forgiving" than the ones
originally from "std_logic_textio"
16) BREAD and BWRITE (binary read and write, same as "READ" and "WRITE" for
SIGNED and UNSIGNED.
17) to_string function - Converts a "SIGNED" or "UNSIGNED" types into a
string. Example:
assert (UNS = "101") report "result was " & to_string(UNS) severity note;
18) to_hstring and to_ostring function (SIGNED or UNSIGNED to hex or octal
string)
E) numeric_std_unsigned - Simular to the "std_logic_unsigned" packages, but
with all of the functionality of the "numeric_std" package.
use model:
use ieee.std_logic_1164.all;
use ieee_proposed.numeric_std_unsigned.all;
dependencies: ieee.numeric_std, ieee_proposed.numeric_std_additions
F) For fixed point package:
use model:
use ieee.std_logic_1164.all;
use ieee.numeric_std.all;
use ieee_proposed.fixed_float_types.all;
use ieee_proposed.fixed_pkg.all;
See fixed point package documentation
http://www.vhdl.org/vhdl-200x/vhdl-200x-ft/packages/Fixed_ug.pdf
G) For floating point package:
use model:
use ieee.std_logic_1164.all;
use ieee.numeric_std.all;
use ieee_proposed.fixed_float_types.all;
use ieee_proposed.fixed_pkg.all;
use ieee_proposed.float_pkg.all;
See floating point package documentation
http://www.vhdl.org/vhdl-200x/vhdl-200x-ft/packages/Float_ug.pdf
@@ -0,0 +1,14 @@
#
# Compile script for Modeltech
#
vlib ieee_proposed.lib
vmap ieee_proposed ieee_proposed.lib
vcom -work ieee_proposed standard_additions_c.vhdl
vcom -work ieee_proposed standard_textio_additions_c.vhdl
vcom -work ieee_proposed env_c.vhdl
vcom -work ieee_proposed std_logic_1164_additions.vhdl
vcom -work ieee_proposed numeric_std_additions.vhdl
vcom -work ieee_proposed numeric_std_unsigned_c.vhdl
vcom -work ieee_proposed fixed_float_types_c.vhdl
vcom -work ieee_proposed fixed_pkg_c.vhdl
vcom -work ieee_proposed float_pkg_c.vhdl
@@ -0,0 +1,48 @@
package ENV is
procedure STOP (STATUS : INTEGER);
procedure FINISH (STATUS : INTEGER);
function RESOLUTION_LIMIT return DELAY_LENGTH;
end package ENV;
library ieee_proposed;
use ieee_proposed.standard_additions.all;
package body ENV is
procedure STOP (STATUS : INTEGER) is
begin
report "Procedure STOP called with status: " & INTEGER'image(STATUS)
severity failure;
end procedure STOP;
procedure FINISH (STATUS : INTEGER) is
begin
report "Procedure FINISH called with status: " & INTEGER'image(STATUS)
severity failure;
end procedure FINISH;
constant BASE_TIME_ARRAY : time_vector :=
(
1 fs, 10 fs, 100 fs,
1 ps, 10 ps, 100 ps,
1 ns, 10 ns, 100 ns,
1 us, 10 us, 100 us,
1 ms, 10 ms, 100 ms,
1 sec, 10 sec, 100 sec,
1 min, 10 min, 100 min,
1 hr, 10 hr, 100 hr
) ;
function RESOLUTION_LIMIT return DELAY_LENGTH is
begin
for i in BASE_TIME_ARRAY'range loop
if BASE_TIME_ARRAY(i) > 0 hr then
return BASE_TIME_ARRAY(i);
end if;
end loop;
report "STANDATD.RESOLUTION_LIMIT: Simulator resolution not less than 100 hr"
severity failure;
return 1 ns;
end function RESOLUTION_LIMIT;
end package body ENV;
@@ -0,0 +1,34 @@
-- --------------------------------------------------------------------
-- "fixed_float_types" package contains types used in the fixed and floating
-- point packages..
-- Please see the documentation for the floating point package.
-- This package should be compiled into "ieee_proposed" and used as follows:
--
-- This verison is designed to work with the VHDL-93 compilers. Please
-- note the "%%%" comments. These are where we diverge from the
-- VHDL-200X LRM.
--
-- --------------------------------------------------------------------
-- Version : $Revision: 1.1 $
-- Date : $Date: 2010/09/22 18:44:20 $
-- --------------------------------------------------------------------
package fixed_float_types is
-- Types used for generics of fixed_generic_pkg
type fixed_round_style_type is (fixed_round, fixed_truncate);
type fixed_overflow_style_type is (fixed_saturate, fixed_wrap);
-- Type used for generics of float_generic_pkg
-- These are the same as the C FE_TONEAREST, FE_UPWARD, FE_DOWNWARD,
-- and FE_TOWARDZERO floating point rounding macros.
type round_type is (round_nearest, -- Default, nearest LSB '0'
round_inf, -- Round toward positive infinity
round_neginf, -- Round toward negative infinity
round_zero); -- Round toward zero (truncate)
end package fixed_float_types;
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,736 @@
-- Synthesis test for the fixed point math package
-- This test is designed to be synthesizable and exercise much of the package.
-- Created for vhdl-200x by David Bishop (dbishop@vhdl.org)
-- --------------------------------------------------------------------
-- modification history : Last Modified $Date: 2006-06-08 10:49:35-04 $
-- Version $Id: fixed_synth.vhdl,v 1.1 2006-06-08 10:49:35-04 l435385 Exp $
-- --------------------------------------------------------------------
library ieee, ieee_proposed;
use ieee.std_logic_1164.all;
use ieee.numeric_std.all;
use ieee_proposed.fixed_float_types.all;
use ieee_proposed.fixed_pkg.all;
entity fixed_synth is
port (
in1, in2 : in STD_LOGIC_VECTOR (15 downto 0); -- inputs
out1 : out STD_LOGIC_VECTOR (15 downto 0); -- output
cmd : in STD_LOGIC_VECTOR (3 downto 0);
clk, rst_n : in STD_ULOGIC); -- clk and reset
end entity fixed_synth;
architecture rtl of fixed_synth is
subtype sfixed7 is sfixed (3 downto -3); -- 7 bit
subtype sfixed16 is sfixed (7 downto -8); -- 16 bit
type cmd_type is array (1 to 15) of STD_ULOGIC_VECTOR (cmd'range); -- cmd
signal cmdarray : cmd_type; -- command pipeline
type cry_type is array (0 to 4) of sfixed16; -- arrays
signal outarray0, outarray1, outarray2, outarray3, outarray4,
outarray5, outarray6, outarray7, outarray8, outarray9, outarray10,
outarray11, outarray12, outarray13, outarray14, outarray15 : sfixed16;
signal in1reg3, in2reg3 : sfixed16; -- register stages
begin -- architecture rtl
-- purpose: "0000" test the "+" operator
cmd0reg : process (clk, rst_n) is
variable in1pin2 : sfixed (SFixed_high(7, -8, '+', 7, -8) downto
SFixed_low(7, -8, '+', 7, -8));
variable outarray : cry_type; -- array for output
variable in1array, in2array : cry_type; -- array for input
begin -- process cmd0reg
if rst_n = '0' then -- asynchronous reset (active low)
outarray0 <= (others => '0');
jrloop : for j in 0 to 4 loop
outarray (j) := (others => '0');
in1array (j) := (others => '0');
in2array (j) := (others => '0');
end loop jrloop;
elsif rising_edge(clk) then -- rising clock edge
outarray0 <= outarray(4);
jcloop : for j in 4 downto 1 loop
outarray (j) := outarray(j-1);
end loop jcloop;
j1loop : for j in 3 downto 1 loop
in1array (j) := in1array(j-1);
end loop j1loop;
j2loop : for j in 3 downto 1 loop
in2array (j) := in2array(j-1);
end loop j2loop;
in1array(0) := in1reg3;
in2array(0) := in2reg3;
in1pin2 := in1array(3) + in2array(3);
outarray(0) := resize (in1pin2, outarray(0));
end if;
end process cmd0reg;
-- purpose: "0001" test the "-" operator
cmd1reg : process (clk, rst_n) is
variable outarray : cry_type; -- array for output
variable in1array, in2array : cry_type; -- array for input
variable in1min2 : sfixed (SFixed_high(in1array(0), '-', in2array(0)) downto
SFixed_low(in1array(0), '-', in2array(0)));
-- variable in1min2 : sfixed (SFixed_high(7, -8, '-', 7, -8) downto
-- SFixed_low(7, -8, '-', 7, -8));
begin -- process cmd0reg
if rst_n = '0' then -- asynchronous reset (active low)
outarray1 <= (others => '0');
jrloop : for j in 0 to 4 loop
outarray (j) := (others => '0');
in1array (j) := (others => '0');
in2array (j) := (others => '0');
end loop jrloop;
elsif rising_edge(clk) then -- rising clock edge
outarray1 <= outarray(4);
jcloop : for j in 4 downto 1 loop
outarray (j) := outarray(j-1);
end loop jcloop;
j1loop : for j in 3 downto 1 loop
in1array (j) := in1array(j-1);
end loop j1loop;
j2loop : for j in 3 downto 1 loop
in2array (j) := in2array(j-1);
end loop j2loop;
in1array(0) := in1reg3;
in2array(0) := in2reg3;
in1min2 := in1array(3) - in2array(3);
outarray(0) := resize (in1min2, outarray(0));
end if;
end process cmd1reg;
-- purpose: "0010" test the "*" operator
cmd2reg : process (clk, rst_n) is
-- variable in1min2 : sfixed (SFixed_high(in1reg3, '*', in2reg3) downto
-- SFixed_low(in1reg3, '*', in2reg3));
variable in1min2 : sfixed (SFixed_high(7, -8, '*', 7, -8) downto
SFixed_low(7, -8, '*', 7, -8));
variable outarray : cry_type; -- array for output
variable in1array, in2array : cry_type; -- array for input
begin -- process cmd0reg
if rst_n = '0' then -- asynchronous reset (active low)
outarray2 <= (others => '0');
jrloop : for j in 0 to 4 loop
outarray (j) := (others => '0');
in1array (j) := (others => '0');
in2array (j) := (others => '0');
end loop jrloop;
elsif rising_edge(clk) then -- rising clock edge
outarray2 <= outarray(4);
jcloop : for j in 4 downto 1 loop
outarray (j) := outarray(j-1);
end loop jcloop;
j1loop : for j in 3 downto 1 loop
in1array (j) := in1array(j-1);
end loop j1loop;
j2loop : for j in 3 downto 1 loop
in2array (j) := in2array(j-1);
end loop j2loop;
in1array(0) := in1reg3;
in2array(0) := in2reg3;
in1min2 := in1array(3) * in2array(3);
outarray(0) := resize (in1min2, outarray(0));
end if;
end process cmd2reg;
-- purpose: "0011" test the "/" operator
cmd3reg : process (clk, rst_n) is
variable in1min2 : sfixed (SFixed_high(in1reg3'high, in1reg3'low,
'/', in2reg3'high, in2reg3'low)
downto
SFixed_low(in1reg3'high, in1reg3'low,
'/', in2reg3'high, in2reg3'low));
variable outarray : cry_type; -- array for output
variable in1array, in2array : cry_type; -- array for input
begin -- process cmd3reg
if rst_n = '0' then -- asynchronous reset (active low)
outarray3 <= (others => '0');
jrloop : for j in 0 to 4 loop
outarray (j) := (others => '0');
in1array (j) := (others => '0');
in2array (j) := to_sfixed(1, in2array(0));
end loop jrloop;
elsif rising_edge(clk) then -- rising clock edge
outarray3 <= outarray(4);
jcloop : for j in 4 downto 1 loop
outarray (j) := outarray(j-1);
end loop jcloop;
j1loop : for j in 3 downto 1 loop
in1array (j) := in1array(j-1);
end loop j1loop;
j2loop : for j in 3 downto 1 loop
in2array (j) := in2array(j-1);
end loop j2loop;
in1array(0) := in1reg3;
if (in2reg3 = 0) then
in2array(0) := to_sfixed(1, in2array(0));
else
in2array(0) := in2reg3;
end if;
in1min2 := in1array(3) / in2array(3);
outarray(0) := resize (in1min2, outarray(0));
end if;
end process cmd3reg;
-- purpose: "0100" test the "+" operator
cmd4reg : process (clk, rst_n) is
variable in1pin2 : ufixed (uFixed_high(7, -8, '+', 7, -8) downto
uFixed_low(7, -8, '+', 7, -8));
variable outarray : cry_type; -- array for output
variable in1array, in2array : cry_type; -- array for input
begin -- process cmd0reg
if rst_n = '0' then -- asynchronous reset (active low)
outarray4 <= (others => '0');
jrloop : for j in 0 to 4 loop
outarray (j) := (others => '0');
in1array (j) := (others => '0');
in2array (j) := (others => '0');
end loop jrloop;
elsif rising_edge(clk) then -- rising clock edge
outarray4 <= outarray(4);
jcloop : for j in 4 downto 1 loop
outarray (j) := outarray(j-1);
end loop jcloop;
j1loop : for j in 3 downto 1 loop
in1array (j) := in1array(j-1);
end loop j1loop;
j2loop : for j in 3 downto 1 loop
in2array (j) := in2array(j-1);
end loop j2loop;
in1array(0) := in1reg3;
in2array(0) := in2reg3;
in1pin2 := ufixed(in1array(3)) + ufixed(in2array(3));
outarray(0) := sfixed (resize (in1pin2, outarray4'high, outarray4'low));
end if;
end process cmd4reg;
-- purpose: "0101" test the "-" operator
cmd5reg : process (clk, rst_n) is
variable in1min2 : ufixed (uFixed_high(7, -8, '-', 7, -8) downto
uFixed_low(7, -8, '-', 7, -8));
variable outarray : cry_type; -- array for output
variable in1array, in2array : cry_type; -- array for input
begin -- process cmd0reg
if rst_n = '0' then -- asynchronous reset (active low)
outarray5 <= (others => '0');
jrloop : for j in 0 to 4 loop
outarray (j) := (others => '0');
in1array (j) := (others => '0');
in2array (j) := (others => '0');
end loop jrloop;
elsif rising_edge(clk) then -- rising clock edge
outarray5 <= outarray(4);
jcloop : for j in 4 downto 1 loop
outarray (j) := outarray(j-1);
end loop jcloop;
j1loop : for j in 3 downto 1 loop
in1array (j) := in1array(j-1);
end loop j1loop;
j2loop : for j in 3 downto 1 loop
in2array (j) := in2array(j-1);
end loop j2loop;
in1array(0) := in1reg3;
in2array(0) := in2reg3;
in1min2 := ufixed(in1array(3)) - ufixed(in2array(3));
outarray(0) := sfixed(resize (in1min2, outarray5'high, outarray5'low));
end if;
end process cmd5reg;
-- purpose: "0110" test the "*" operator
cmd6reg : process (clk, rst_n) is
variable in1min2 : ufixed (uFixed_high(7, -8, '*', 7, -8) downto
uFixed_low(7, -8, '*', 7, -8));
variable outarray : cry_type; -- array for output
variable in1array, in2array : cry_type; -- array for input
begin -- process cmd0reg
if rst_n = '0' then -- asynchronous reset (active low)
outarray6 <= (others => '0');
jrloop : for j in 0 to 4 loop
outarray (j) := (others => '0');
in1array (j) := (others => '0');
in2array (j) := (others => '0');
end loop jrloop;
elsif rising_edge(clk) then -- rising clock edge
outarray6 <= outarray(4);
jcloop : for j in 4 downto 1 loop
outarray (j) := outarray(j-1);
end loop jcloop;
j1loop : for j in 3 downto 1 loop
in1array (j) := in1array(j-1);
end loop j1loop;
j2loop : for j in 3 downto 1 loop
in2array (j) := in2array(j-1);
end loop j2loop;
in1array(0) := in1reg3;
in2array(0) := in2reg3;
in1min2 := ufixed(in1array(3)) * ufixed(in2array(3));
outarray(0) := sfixed(resize (in1min2, outarray6'high, outarray6'low));
end if;
end process cmd6reg;
-- purpose: "0111" test the "/" operator
cmd7reg : process (clk, rst_n) is
variable in1min2 : ufixed (uFixed_high(7, -8, '/', 7, -8) downto
uFixed_low(7, -8, '/', 7, -8));
variable outarray : cry_type; -- array for output
variable in1array, in2array : cry_type; -- array for input
begin -- process cmd0reg
if rst_n = '0' then -- asynchronous reset (active low)
outarray7 <= (others => '0');
jrloop : for j in 0 to 4 loop
outarray (j) := (others => '0');
in1array (j) := (others => '0');
in2array (j) := sfixed(to_ufixed(1, in2reg3'high, in2reg3'low));
end loop jrloop;
elsif rising_edge(clk) then -- rising clock edge
outarray7 <= outarray(4);
jcloop : for j in 4 downto 1 loop
outarray (j) := outarray(j-1);
end loop jcloop;
j1loop : for j in 3 downto 1 loop
in1array (j) := in1array(j-1);
end loop j1loop;
j2loop : for j in 3 downto 1 loop
in2array (j) := in2array(j-1);
end loop j2loop;
in1array(0) := in1reg3;
if (in2reg3 = 0) then
in2array(0) := sfixed(to_ufixed(1, in2reg3'high, in2reg3'low));
else
in2array(0) := in2reg3;
end if;
in1min2 := ufixed(in1array(3)) / ufixed(in2array(3));
outarray(0) := sfixed(resize (in1min2, outarray7'high, outarray7'low));
end if;
end process cmd7reg;
-- purpose: "1000" test the resize test
cmd8reg : process (clk, rst_n) is
variable tmpfp71, tmpfp72 : sfixed7; -- 8 bit fp number
variable outarray : cry_type; -- array for output
variable in1array, in2array : cry_type; -- array for input
begin -- process cmd0reg
if rst_n = '0' then -- asynchronous reset (active low)
outarray8 <= (others => '0');
jrloop : for j in 0 to 4 loop
outarray (j) := (others => '0');
in1array (j) := (others => '0');
in2array (j) := (others => '0');
end loop jrloop;
elsif rising_edge(clk) then -- rising clock edge
outarray8 <= outarray(4);
jcloop : for j in 4 downto 1 loop
outarray (j) := outarray(j-1);
end loop jcloop;
j1loop : for j in 3 downto 1 loop
in1array (j) := in1array(j-1);
end loop j1loop;
j2loop : for j in 3 downto 1 loop
in2array (j) := in2array(j-1);
end loop j2loop;
in1array(0) := in1reg3;
in2array(0) := in2reg3;
-- Resize test Convert inputs into two 8 bit numbers
tmpfp71 := resize (in1array(3), tmpfp71'high, tmpfp71'low,
fixed_wrap, fixed_truncate);
tmpfp72 := resize (in2array(3), tmpfp72'high, tmpfp72'low,
fixed_saturate, fixed_round);
outarray(0) := (others => '0');
fx1 : for i in tmpfp71'range loop
outarray(0)(i+4) := tmpfp71(i);
end loop fx1;
fx2 : for i in tmpfp72'range loop
outarray(0)(i-4) := tmpfp72(i);
end loop fx2;
end if;
end process cmd8reg;
-- purpose: "1001" test the to_signed/unsigned test
cmd9reg : process (clk, rst_n) is
variable tmp : STD_LOGIC_VECTOR (1 downto 0); -- temp
variable tmpsig : SIGNED (7 downto 0); -- signed number
variable tmpuns : UNSIGNED (15 downto 0); -- unsigned number
variable tmpint : INTEGER;
variable outarray : cry_type; -- array for output
variable in1array, in2array : cry_type; -- array for input
begin -- process cmd0reg
if rst_n = '0' then -- asynchronous reset (active low)
outarray9 <= (others => '0');
jrloop : for j in 0 to 4 loop
outarray (j) := (others => '0');
in1array (j) := (others => '0');
in2array (j) := (others => '0');
end loop jrloop;
elsif rising_edge(clk) then -- rising clock edge
outarray9 <= outarray(4);
jcloop : for j in 4 downto 1 loop
outarray (j) := outarray(j-1);
end loop jcloop;
j1loop : for j in 3 downto 1 loop
in1array (j) := in1array(j-1);
end loop j1loop;
j2loop : for j in 3 downto 1 loop
in2array (j) := in2array(j-1);
end loop j2loop;
in1array(0) := in1reg3;
in2array(0) := in2reg3;
tmp := to_slv (in2array(3)(in2reg3'high downto in2reg3'high-1));
if (tmp = "00") then
-- Signed to sfixed and back
tmpsig := to_signed (in1array(3), tmpsig'length);
outarray(0) := to_sfixed (tmpsig, outarray(0));
elsif (tmp = "01") then
-- unsigned to ufixed and back
tmpuns := to_unsigned (ufixed(in1array(3)), tmpuns'length);
outarray(0) := sfixed(to_ufixed (tmpuns, outarray(0)'high,
outarray(0)'low));
elsif (tmp = "10") then
tmpint := to_integer (in1array(3));
outarray(0) := to_sfixed (tmpint, outarray(0));
else
tmpint := to_integer (ufixed(in1array(3)));
outarray(0) := sfixed(to_ufixed (tmpint, outarray(0)'high,
outarray(0)'low));
end if;
end if;
end process cmd9reg;
-- purpose: "1010" test the reciprocal, abs, - test
cmd10reg : process (clk, rst_n) is
variable tmp : STD_LOGIC_VECTOR (1 downto 0); -- temp
variable in1recip : sfixed (-in1reg3'low+1 downto -in1reg3'high);
variable uin1recip : ufixed (-in1reg3'low downto -in1reg3'high-1);
variable in1pin2 : sfixed (SFixed_high(7, -8, '+', 7, -8) downto
SFixed_low(7, -8, '+', 7, -8));
variable outarray : cry_type; -- array for output
variable in1array, in2array : cry_type; -- array for input
begin -- process cmd0reg
if rst_n = '0' then -- asynchronous reset (active low)
outarray10 <= (others => '0');
jrloop : for j in 0 to 4 loop
outarray (j) := (others => '0');
in1array (j) := to_sfixed(1, in1reg3);
in2array (j) := (others => '0');
end loop jrloop;
elsif rising_edge(clk) then -- rising clock edge
outarray10 <= outarray(4);
jcloop : for j in 4 downto 1 loop
outarray (j) := outarray(j-1);
end loop jcloop;
j1loop : for j in 3 downto 1 loop
in1array (j) := in1array(j-1);
end loop j1loop;
j2loop : for j in 3 downto 1 loop
in2array (j) := in2array(j-1);
end loop j2loop;
if (in1reg3 = 0) then
in1array(0) := to_sfixed(1, in1reg3);
else
in1array(0) := in1reg3;
end if;
in2array(0) := in2reg3;
tmp := to_slv (in2array(3)(in2reg3'high downto in2reg3'high-1));
if (tmp = "00") then
in1recip := reciprocal (in1array(3));
outarray(0) := resize (in1recip, outarray(0)'high,
outarray(0)'low);
elsif (tmp = "01") then
uin1recip := reciprocal (ufixed(in1array(3)));
outarray(0) := sfixed(resize (uin1recip, outarray(0)'high,
outarray(0)'low));
elsif (tmp = "10") then
-- abs
in1pin2 := abs(in1array(3));
outarray(0) := resize (in1pin2,
outarray(0)'high,
outarray(0)'low);
else
-- -
in1pin2 := - in1array(3);
outarray(0) := resize (in1pin2,
outarray(0)'high,
outarray(0)'low);
end if;
end if;
end process cmd10reg;
-- purpose: "1011" test the mod operator
cmd11reg : process (clk, rst_n) is
variable in1min2 : sfixed (SFixed_high(7, -8, 'M', 7, -8) downto
SFixed_low(7, -8, 'm', 7, -8));
variable outarray : cry_type; -- array for output
variable in1array, in2array : cry_type; -- array for input
begin -- process cmd0reg
if rst_n = '0' then -- asynchronous reset (active low)
outarray11 <= (others => '0');
jrloop : for j in 0 to 4 loop
outarray (j) := (others => '0');
in1array (j) := (others => '0');
in2array (j) := to_sfixed(1, in2array(0));
end loop jrloop;
elsif rising_edge(clk) then -- rising clock edge
outarray11 <= outarray(4);
jcloop : for j in 4 downto 1 loop
outarray (j) := outarray(j-1);
end loop jcloop;
j1loop : for j in 3 downto 1 loop
in1array (j) := in1array(j-1);
end loop j1loop;
j2loop : for j in 3 downto 1 loop
in2array (j) := in2array(j-1);
end loop j2loop;
in1array(0) := in1reg3;
if (in2reg3 = 0) then
in2array(0) := to_sfixed(1, in2array(0));
else
in2array(0) := in2reg3;
end if;
in1min2 := in1array(3) mod in2array(3);
outarray(0) := resize (in1min2, outarray(0));
end if;
end process cmd11reg;
-- purpose: "1100" test the rem operator
cmd12reg : process (clk, rst_n) is
variable in1min2 : sfixed (SFixed_high(7, -8, 'R', 7, -8) downto
SFixed_low(7, -8, 'r', 7, -8));
variable outarray : cry_type; -- array for output
variable in1array, in2array : cry_type; -- array for input
begin -- process cmd0reg
if rst_n = '0' then -- asynchronous reset (active low)
outarray12 <= (others => '0');
jrloop : for j in 0 to 4 loop
outarray (j) := (others => '0');
in1array (j) := (others => '0');
in2array (j) := to_sfixed(1, in2array(0));
end loop jrloop;
elsif rising_edge(clk) then -- rising clock edge
outarray12 <= outarray(4);
jcloop : for j in 4 downto 1 loop
outarray (j) := outarray(j-1);
end loop jcloop;
j1loop : for j in 3 downto 1 loop
in1array (j) := in1array(j-1);
end loop j1loop;
j2loop : for j in 3 downto 1 loop
in2array (j) := in2array(j-1);
end loop j2loop;
in1array(0) := in1reg3;
if (in2reg3 = 0) then
in2array(0) := to_sfixed(1, in2array(0));
else
in2array(0) := in2reg3;
end if;
in1min2 := in1array(3) rem in2array(3);
outarray(0) := resize (in1min2, outarray(0));
end if;
end process cmd12reg;
-- purpose: "1101" test the srl operator
cmd13reg : process (clk, rst_n) is
variable outarray : cry_type; -- array for output
variable in1array, in2array : cry_type; -- array for input
begin -- process cmd0reg
if rst_n = '0' then -- asynchronous reset (active low)
outarray13 <= (others => '0');
jrloop : for j in 0 to 4 loop
outarray (j) := (others => '0');
in1array (j) := (others => '0');
in2array (j) := (others => '0');
end loop jrloop;
elsif rising_edge(clk) then -- rising clock edge
outarray13 <= outarray(4);
jcloop : for j in 4 downto 1 loop
outarray (j) := outarray(j-1);
end loop jcloop;
j1loop : for j in 3 downto 1 loop
in1array (j) := in1array(j-1);
end loop j1loop;
j2loop : for j in 3 downto 1 loop
in2array (j) := in2array(j-1);
end loop j2loop;
in1array(0) := in1reg3;
in2array(0) := in2reg3;
outarray(0) := in1array(3) srl to_integer(in2array(3));
end if;
end process cmd13reg;
-- purpose: "1110" test the sra operator
cmd14reg : process (clk, rst_n) is
variable outarray : cry_type; -- array for output
variable in1array, in2array : cry_type; -- array for input
begin -- process cmd0reg
if rst_n = '0' then -- asynchronous reset (active low)
outarray14 <= (others => '0');
jrloop : for j in 0 to 4 loop
outarray (j) := (others => '0');
in1array (j) := (others => '0');
in2array (j) := (others => '0');
end loop jrloop;
elsif rising_edge(clk) then -- rising clock edge
outarray14 <= outarray(4);
jcloop : for j in 4 downto 1 loop
outarray (j) := outarray(j-1);
end loop jcloop;
j1loop : for j in 3 downto 1 loop
in1array (j) := in1array(j-1);
end loop j1loop;
j2loop : for j in 3 downto 1 loop
in2array (j) := in2array(j-1);
end loop j2loop;
in1array(0) := in1reg3;
in2array(0) := in2reg3;
outarray(0) := in1array(3) sra to_integer(in2array(3));
end if;
end process cmd14reg;
-- purpose: "1111" test the sra operator
cmd15reg : process (clk, rst_n) is
constant match_data : sfixed16 := "01HL----10HL----"; -- for ?= command
variable outarray : cry_type; -- array for output
variable in1array, in2array : cry_type; -- array for input
begin -- process cmd0reg
if rst_n = '0' then -- asynchronous reset (active low)
outarray15 <= (others => '0');
jrloop : for j in 0 to 4 loop
outarray (j) := (others => '0');
in1array (j) := (others => '0');
in2array (j) := (others => '0');
end loop jrloop;
elsif rising_edge(clk) then -- rising clock edge
outarray15 <= outarray(4);
jcloop : for j in 4 downto 1 loop
outarray (j) := outarray(j-1);
end loop jcloop;
j1loop : for j in 3 downto 1 loop
in1array (j) := in1array(j-1);
end loop j1loop;
j2loop : for j in 3 downto 1 loop
in2array (j) := in2array(j-1);
end loop j2loop;
in1array(0) := in1reg3;
in2array(0) := in2reg3;
-- compare test
if (in1array(3) = in2array(3)) then
outarray(0)(-8) := '1';
else
outarray(0)(-8) := '0';
end if;
if (in1array(3) /= in2array(3)) then
outarray(0)(-7) := '1';
else
outarray(0)(-7) := '0';
end if;
if (in1array(3) < in2array(3)) then
outarray(0)(-6) := '1';
else
outarray(0)(-6) := '0';
end if;
if (in1array(3) > in2array(3)) then
outarray(0)(-5) := '1';
else
outarray(0)(-5) := '0';
end if;
if (in1array(3) <= in2array(3)) then
outarray(0)(-4) := '1';
else
outarray(0)(-4) := '0';
end if;
if (in1array(3) >= in2array(3)) then
outarray(0)(-3) := '1';
else
outarray(0)(-3) := '0';
end if;
if (in1array(3) = 45) then
outarray(0)(-2) := '1';
else
outarray(0)(-2) := '0';
end if;
if (in1array(3) = 3.125) then
outarray(0)(-1) := '1';
else
outarray(0)(-1) := '0';
end if;
-- add integer and real
outarray(0)(0) := \?=\ (in1array(3), in2array(3) + 45);
if (in1array(3) = in2array(3) + 3.125) then
outarray(0)(1) := '1';
else
outarray(0)(1) := '0';
end if;
if (std_match (in1array(3), match_data)) then
outarray(0)(2) := '1';
else
outarray(0)(2) := '0';
end if;
outarray(0)(3) := nor_reduce (in1array(3) or in2array(3));
outarray(0)(4) := xnor_reduce (in1array(3) xor in2array(3));
outarray(0)(5) := nand_reduce (not in1array(3));
outarray(0)(6) := or_reduce ('1' and ufixed(in1array(3)));
if find_leftmost(in1array(3), '1') = 3 then
outarray(0)(7) := '1';
else
outarray(0)(7) := '0';
end if;
end if;
end process cmd15reg;
-- purpose: register the inputs and the outputs
-- type : sequential
-- inputs : clk, rst_n, in1, in2
-- outputs: out1
cmdreg : process (clk, rst_n) is
variable outreg : sfixed16; -- register stages
variable in1reg, in2reg : sfixed16; -- register stages
variable in1reg2, in2reg2 : sfixed16; -- register stages
begin -- process mulreg
if rst_n = '0' then -- asynchronous reset (active low)
in1reg := (others => '0');
in2reg := (others => '0');
in1reg2 := (others => '0');
in2reg2 := (others => '0');
in1reg3 <= (others => '0');
in2reg3 <= (others => '0');
out1 <= (others => '0');
outreg := (others => '0');
rcloop : for i in 1 to 15 loop
cmdarray (i) <= (others => '0');
end loop rcloop;
elsif rising_edge(clk) then -- rising clock edge
out1 <= to_slv (outreg);
outregc : case cmdarray (13) is
when "0000" => outreg := outarray0;
when "0001" => outreg := outarray1;
when "0010" => outreg := outarray2;
when "0011" => outreg := outarray3;
when "0100" => outreg := outarray4;
when "0101" => outreg := outarray5;
when "0110" => outreg := outarray6;
when "0111" => outreg := outarray7;
when "1000" => outreg := outarray8;
when "1001" => outreg := outarray9;
when "1010" => outreg := outarray10;
when "1011" => outreg := outarray11;
when "1100" => outreg := outarray12;
when "1101" => outreg := outarray13;
when "1110" => outreg := outarray14;
when "1111" => outreg := outarray15;
when others => null;
end case outregc;
cmdpipe : for i in 15 downto 3 loop
cmdarray (i) <= cmdarray (i-1);
end loop cmdpipe;
cmdarray (2) <= STD_ULOGIC_VECTOR(cmd);
in1reg3 <= in1reg2;
in2reg3 <= in2reg2;
in1reg2 := in1reg;
in2reg2 := in2reg;
in1reg := to_sfixed (in1, in1reg);
in2reg := to_sfixed (in2, in2reg);
end if;
end process cmdreg;
end architecture rtl;
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,709 @@
-------------------------------------------------------------------------------
-- Synthesis test for the floating point math package
-- This test is designed to be synthesizable and exercise much of the package.
-- Created for vhdl-200x by David Bishop (dbishop@vhdl.org)
-- --------------------------------------------------------------------
-- modification history : Last Modified $Date: 2006-06-08 10:50:32-04 $
-- Version $Id: float_synth.vhdl,v 1.1 2006-06-08 10:50:32-04 l435385 Exp $
-------------------------------------------------------------------------------
library ieee, ieee_proposed;
use ieee.std_logic_1164.all;
use ieee.numeric_std.all;
use ieee_proposed.fixed_float_types.all;
use ieee_proposed.fixed_pkg.all;
use ieee_proposed.float_pkg.all;
use ieee.math_real.all;
entity float_synth is
port (
in1, in2 : in std_logic_vector (31 downto 0); -- inputs
out1 : out std_logic_vector (31 downto 0); -- output
cmd : in std_logic_vector (3 downto 0);
clk, rst_n : in std_ulogic); -- clk and reset
end entity float_synth;
architecture rtl of float_synth is
subtype fp16 is float (6 downto -9); -- 16 bit
type cmd_type is array (1 to 15) of std_ulogic_vector (cmd'range); -- cmd
signal cmdarray : cmd_type; -- command pipeline
type cry_type is array (0 to 15) of float32; -- arrays
signal outx : cry_type;
signal in1reg3, in2reg3 : float32; -- register stages
begin -- architecture rtl
-- purpose: "0000" test the "+" operator
cmd0reg: process (clk, rst_n) is
variable outarray : cry_type; -- array for output
begin -- process cmd0reg
if rst_n = '0' then -- asynchronous reset (active low)
outx(0) <= ( others => '0');
jrloop: for j in 0 to 7 loop
outarray (j) := (others => '0');
end loop jrloop;
elsif rising_edge(clk) then -- rising clock edge
outx(0) <= outarray(7);
jcloop: for j in 7 downto 1 loop
outarray (j) := outarray(j-1);
end loop jcloop;
outarray(0) := in1reg3 + in2reg3;
end if;
end process cmd0reg;
-- purpose: "0001" test the "-" operator
cmd1reg: process (clk, rst_n) is
variable outarray : cry_type; -- array for output
begin -- process cmd1reg
if rst_n = '0' then -- asynchronous reset (active low)
outx(1) <= ( others => '0');
jrloop: for j in 0 to 7 loop
outarray (j) := (others => '0');
end loop jrloop;
elsif rising_edge(clk) then -- rising clock edge
outx(1) <= outarray(7);
jcloop: for j in 7 downto 1 loop
outarray (j) := outarray(j-1);
end loop jcloop;
outarray(0) := in1reg3 - in2reg3;
end if;
end process cmd1reg;
-- purpose: "0010" test the "*" operator
cmd2reg: process (clk, rst_n) is
variable outarray : cry_type; -- array for output
begin -- process cmd2reg
if rst_n = '0' then -- asynchronous reset (active low)
outx(2) <= ( others => '0');
jrloop: for j in 0 to 7 loop
outarray (j) := (others => '0');
end loop jrloop;
elsif rising_edge(clk) then -- rising clock edge
outx(2) <= outarray(7);
jcloop: for j in 7 downto 1 loop
outarray (j) := outarray(j-1);
end loop jcloop;
outarray(0) := in1reg3 * in2reg3;
end if;
end process cmd2reg;
-- purpose: "0011" performs test the "/" operator
cmd3reg: process (clk, rst_n) is
variable outarray : cry_type; -- array for output
begin -- process cmd1reg
if rst_n = '0' then -- asynchronous reset (active low)
outx(3) <= ( others => '0');
jrloop: for j in 0 to 7 loop
outarray (j) := (others => '0');
end loop jrloop;
elsif rising_edge(clk) then -- rising clock edge
outx(3) <= outarray(7);
jcloop: for j in 7 downto 1 loop
outarray (j) := outarray(j-1);
end loop jcloop;
if (cmdarray(4) = "0011") then
outarray(0) := in1reg3 / in2reg3;
else
outarray(0) := (others => '0');
end if;
end if;
end process cmd3reg;
-- purpose: "0100" test the "resize" function
cmd4reg: process (clk, rst_n) is
variable tmpfp161, tmpfp162 : fp16; -- 16 bit fp number
variable outarray : cry_type; -- array for output
variable tmpcmd : STD_LOGIC_VECTOR (2 downto 0);
begin -- process cmd1reg
if rst_n = '0' then -- asynchronous reset (active low)
outx(4) <= ( others => '0');
jrloop: for j in 0 to 7 loop
outarray (j) := (others => '0');
end loop jrloop;
elsif rising_edge(clk) then -- rising clock edge
outx(4) <= outarray(7);
jcloop: for j in 7 downto 1 loop
outarray (j) := outarray(j-1);
end loop jcloop;
tmpcmd := to_slv (in2reg3 (in2reg3'low+2 downto in2reg3'low));
case tmpcmd is
when "000" =>
tmpfp161 := resize ( arg => in1reg3,
exponent_width => tmpfp161'high,
fraction_width => -tmpfp161'low,
denormalize_in => true,
denormalize => false,
round_style => round_zero);
when "001" =>
tmpfp161 := resize ( arg => in1reg3,
-- size_res => tmpfp161,
exponent_width => tmpfp161'high,
fraction_width => -tmpfp161'low,
denormalize_in => false,
denormalize => false);
when "010" =>
tmpfp161 := resize ( arg => in1reg3,
exponent_width => tmpfp161'high,
fraction_width => -tmpfp161'low,
denormalize_in => false,
denormalize => false);
when "011" =>
tmpfp161 := resize ( arg => in1reg3,
-- size_res => tmpfp161,
exponent_width => tmpfp161'high,
fraction_width => -tmpfp161'low,
denormalize_in => true,
denormalize => false,
round_style => round_inf);
when "100" =>
tmpfp161 := resize ( arg => in1reg3,
exponent_width => tmpfp161'high,
fraction_width => -tmpfp161'low,
denormalize_in => true,
denormalize => false,
round_style => round_neginf);
when "101" =>
tmpfp161 := resize ( arg => in1reg3,
-- size_res => tmpfp161,
exponent_width => tmpfp161'high,
fraction_width => -tmpfp161'low,
denormalize_in => true,
denormalize => false,
check_error => false,
round_style => round_zero);
when "110" =>
tmpfp161 := resize ( arg => in1reg3,
exponent_width => tmpfp161'high,
fraction_width => -tmpfp161'low);
when "111" =>
tmpfp161 := resize ( arg => in1reg3,
exponent_width => tmpfp161'high,
fraction_width => -tmpfp161'low
-- size_res => tmpfp161
);
when others => null;
end case;
outarray(0)(-8 downto -23) := tmpfp161;
outarray(0)(8 downto 6) := float(tmpcmd);
outarray(0)(6 downto -7) := (others => '0');
end if;
end process cmd4reg;
-- purpose: "0101" Conversion function test
cmd5reg: process (clk, rst_n) is
variable uns : unsigned (15 downto 0); -- unsigned number
variable s : signed (15 downto 0); -- signed number
variable uf : ufixed (8 downto -7); -- unsigned fixed
variable sf : sfixed (8 downto -7); -- signed fixed point
variable outarray : cry_type; -- array for output
variable tmpcmd : STD_LOGIC_VECTOR (2 downto 0);
begin -- process cmd1reg
if rst_n = '0' then -- asynchronous reset (active low)
outx(5) <= ( others => '0');
jrloop: for j in 0 to 7 loop
outarray (j) := (others => '0');
end loop jrloop;
elsif rising_edge(clk) then -- rising clock edge
outx(5) <= outarray(7);
jcloop: for j in 7 downto 1 loop
outarray (j) := outarray(j-1);
end loop jcloop;
tmpcmd := to_slv (in2reg3 (in2reg3'low+2 downto in2reg3'low));
case tmpcmd is
when "000" =>
uns := to_unsigned (in1reg3, uns'length);
outarray(0)(-8 downto -23) := float(std_logic_vector(uns));
when "001" =>
uns := to_unsigned (in1reg3, uns);
outarray(0)(-8 downto -23) := float(std_logic_vector(uns));
when "010" =>
s := to_signed (in1reg3, s'length);
outarray(0)(-8 downto -23) := float(std_logic_vector(s));
when "011" =>
s := to_signed (in1reg3, s);
outarray(0)(-8 downto -23) := float(std_logic_vector(s));
when "100" =>
uf := to_ufixed (in1reg3, uf'high, uf'low);
outarray(0)(-8 downto -23) := float(to_slv(uf));
when "101" =>
uf := to_ufixed (in1reg3, uf);
outarray(0)(-8 downto -23) := float(to_slv(uf));
when "110" =>
sf := to_sfixed (in1reg3, sf'high, sf'low);
outarray(0)(-8 downto -23) := float(to_slv(sf));
when "111" =>
sf := to_sfixed (in1reg3, sf);
outarray(0)(-8 downto -23) := float(to_slv(sf));
when others => null;
end case;
outarray(0)(8 downto 6) := float(tmpcmd);
outarray(0)(5 downto -7) := (others => '0');
end if;
end process cmd5reg;
-- purpose: "0110" to_float()
cmd6reg: process (clk, rst_n) is
variable uns : unsigned (15 downto 0); -- unsigned number
variable s : signed (15 downto 0); -- signed number
variable uf : ufixed (8 downto -7); -- unsigned fixed
variable sf : sfixed (8 downto -7); -- signed fixed point
variable outarray : cry_type; -- array for output
variable tmpcmd : STD_LOGIC_VECTOR (2 downto 0);
begin -- process cmd1reg
if rst_n = '0' then -- asynchronous reset (active low)
outx(6) <= ( others => '0');
jrloop: for j in 0 to 7 loop
outarray (j) := (others => '0');
end loop jrloop;
elsif rising_edge(clk) then -- rising clock edge
outx(6) <= outarray(7);
jcloop: for j in 7 downto 1 loop
outarray (j) := outarray(j-1);
end loop jcloop;
tmpcmd := to_slv (in2reg3 (in2reg3'low+2 downto in2reg3'low));
case tmpcmd is
when "000" =>
uns := UNSIGNED (to_slv (in1reg3(-8 downto -23)));
outarray(0) := to_float(uns, 8, 23);
when "001" =>
uns := UNSIGNED (to_slv (in1reg3(-8 downto -23)));
outarray(0) := to_float(uns, in1reg3);
when "010" =>
s := SIGNED (to_slv (in1reg3(-8 downto -23)));
outarray(0) := to_float(s, 8, 23);
when "011" =>
s := SIGNED (to_slv (in1reg3(-8 downto -23)));
outarray(0) := to_float(s, in1reg3);
when "100" =>
uf := to_ufixed (to_slv (in1reg3(-8 downto -23)), uf'high, uf'low);
outarray(0) := to_float(uf, 8, 23);
when "101" =>
uf := to_ufixed (to_slv (in1reg3(-8 downto -23)), uf);
outarray(0) := to_float(uf, in1reg3);
when "110" =>
sf := to_sfixed (to_slv (in1reg3(-8 downto -23)), sf'high, sf'low);
outarray(0) := to_float(sf, 8, 23);
when "111" =>
sf := to_sfixed (to_slv (in1reg3(-8 downto -23)), sf);
outarray(0) := to_float(sf, in1reg3);
when others => null;
end case;
end if;
end process cmd6reg;
-- purpose: "0111" mod function
cmd7reg: process (clk, rst_n) is
variable tmpuns : unsigned (31 downto 0); -- unsigned number
variable outarray : cry_type; -- array for output
begin -- process cmd1reg
if rst_n = '0' then -- asynchronous reset (active low)
outx(7) <= ( others => '0');
jrloop: for j in 0 to 7 loop
outarray (j) := (others => '0');
end loop jrloop;
elsif rising_edge(clk) then -- rising clock edge
outx(7) <= outarray(7);
jcloop: for j in 7 downto 1 loop
outarray (j) := outarray(j-1);
end loop jcloop;
outarray(0) := in1reg3 mod in2reg3;
end if;
end process cmd7reg;
-- purpose: "1000" rem function
cmd8reg: process (clk, rst_n) is
variable outarray : cry_type; -- array for output
begin -- process cmd2reg
if rst_n = '0' then -- asynchronous reset (active low)
outx(8) <= ( others => '0');
jrloop: for j in 0 to 7 loop
outarray (j) := (others => '0');
end loop jrloop;
elsif rising_edge(clk) then -- rising clock edge
outx(8) <= outarray(7);
jcloop: for j in 7 downto 1 loop
outarray (j) := outarray(j-1);
end loop jcloop;
outarray(0) := in1reg3 rem in2reg3;
end if;
end process cmd8reg;
-- purpose: "1001" to_float (constants) test
cmd9reg: process (clk, rst_n) is
variable outarray : cry_type; -- array for output
variable tmpcmd : STD_LOGIC_VECTOR (2 downto 0);
begin -- process cmd2reg
if rst_n = '0' then -- asynchronous reset (active low)
outx(9) <= ( others => '0');
jrloop: for j in 0 to 7 loop
outarray (j) := (others => '0');
end loop jrloop;
elsif rising_edge(clk) then -- rising clock edge
outx(9) <= outarray(7);
jcloop: for j in 7 downto 1 loop
outarray (j) := outarray(j-1);
end loop jcloop;
tmpcmd := to_slv (in2reg3 (in2reg3'low+2 downto in2reg3'low));
case tmpcmd is
when "000" =>
outarray(0) := to_float(0, 8, 23);
when "001" =>
outarray(0) := to_float(0.0, 8, 23);
when "010" =>
outarray(0) := to_float(8, in1reg3);
when "011" =>
outarray(0) := to_float(8.0, in1reg3);
when "100" =>
outarray(0) := to_float(-8, 8, 23);
when "101" =>
outarray(0) := to_float(-8.0, 8, 23);
when "110" =>
outarray(0) := to_float(27000, in2reg3);
when "111" =>
-- outarray(0) := "01000000010010010000111111011011";
outarray(0) := to_float(MATH_PI, in2reg3);
when others => null;
end case;
end if;
end process cmd9reg;
-- purpose: "1010" data manipulation (+, -, scalb, etc)
cmd10reg: process (clk, rst_n) is
variable tmpcmd : STD_LOGIC_VECTOR (2 downto 0);
variable s : SIGNED (7 downto 0); -- signed number
variable outarray : cry_type; -- array for output
constant posinf : float32 := "01111111100000000000000000000000"; -- +inf
constant neginf : float32 := "11111111100000000000000000000000"; -- +inf
constant onept5 : float32 := "00111111110000000000000000000000"; -- 1.5
begin -- process cmd2reg
if rst_n = '0' then -- asynchronous reset (active low)
outx(10) <= ( others => '0');
jrloop: for j in 0 to 7 loop
outarray (j) := (others => '0');
end loop jrloop;
elsif rising_edge(clk) then -- rising clock edge
outx(10) <= outarray(7);
jcloop: for j in 7 downto 1 loop
outarray (j) := outarray(j-1);
end loop jcloop;
tmpcmd := to_slv (in2reg3 (in2reg3'low+2 downto in2reg3'low));
case tmpcmd is
when "000" =>
outarray(0) := - in1reg3;
when "001" =>
outarray(0) := abs( in1reg3);
when "010" =>
if (cmdarray(4) = "1010") then
s := resize (SIGNED (to_slv (in2reg3(8 downto 5))), s'length);
outarray(0) := Scalb (in1reg3, s);
else
outarray(0) := (others => '0');
end if;
when "011" =>
if (cmdarray(4) = "1010") then
s := logb (in1reg3);
outarray(0) := (others => '0');
outarray(0)(-16 downto -23) := float(std_logic_vector(s));
else
outarray(0) := (others => '0');
end if;
when "100" =>
outarray(0) := Nextafter ( in1reg3, onept5);
when "101" =>
outarray(0) := Nextafter ( in1reg3, -onept5);
when "110" =>
outarray(0) := Nextafter ( x => in1reg3, y => posinf,
check_error => false,
denormalize => false);
when "111" =>
outarray(0) := Nextafter (x => in1reg3, y => neginf,
check_error => false,
denormalize => false);
when others => null;
end case;
end if;
end process cmd10reg;
-- purpose "1011" copysign
cmd11reg: process (clk, rst_n) is
variable outarray : cry_type; -- array for output
begin -- process cmd2reg
if rst_n = '0' then -- asynchronous reset (active low)
outx(11) <= ( others => '0');
jrloop: for j in 0 to 7 loop
outarray (j) := (others => '0');
end loop jrloop;
elsif rising_edge(clk) then -- rising clock edge
outx(11) <= outarray(7);
jcloop: for j in 7 downto 1 loop
outarray (j) := outarray(j-1);
end loop jcloop;
outarray(0) := Copysign (in1reg3, in2reg3);
end if;
end process cmd11reg;
-- purpose "1100" compare test
cmd12reg: process (clk, rst_n) is
variable outarray : cry_type; -- array for output
constant fifteenpt5 : float32 := "01000001011110000000000000000000";-- 15.5
begin -- process cmd2reg
if rst_n = '0' then -- asynchronous reset (active low)
outx(12) <= ( others => '0');
jrloop: for j in 0 to 7 loop
outarray (j) := (others => '0');
end loop jrloop;
elsif rising_edge(clk) then -- rising clock edge
outx(12) <= outarray(7);
jcloop: for j in 7 downto 1 loop
outarray (j) := outarray(j-1);
end loop jcloop;
outarray(0) := (others => '0');
if (in1reg3 = in2reg3) then
outarray(0)(outarray(0)'high) := '1';
else
outarray(0)(outarray(0)'high) := '0';
end if;
if (in1reg3 /= in2reg3) then
outarray(0)(outarray(0)'high-1) := '1';
else
outarray(0)(outarray(0)'high-1) := '0';
end if;
if (in1reg3 > in2reg3) then
outarray(0)(outarray(0)'high-2) := '1';
else
outarray(0)(outarray(0)'high-2) := '0';
end if;
if (in1reg3 < in2reg3) then
outarray(0)(outarray(0)'high-3) := '1';
else
outarray(0)(outarray(0)'high-3) := '0';
end if;
if (in1reg3 >= in2reg3) then
outarray(0)(outarray(0)'high-4) := '1';
else
outarray(0)(outarray(0)'high-4) := '0';
end if;
if (in1reg3 <= in2reg3) then
outarray(0)(outarray(0)'high-5) := '1';
else
outarray(0)(outarray(0)'high-5) := '0';
end if;
outarray(0)(outarray(0)'high-6) := \?=\ (in1reg3, 15);
outarray(0)(outarray(0)'high-7) := \?=\ (in1reg3, 15.5);
if (Unordered (in1reg3, in2reg3)) then
outarray(0)(outarray(0)'high-8) := '1';
else
outarray(0)(outarray(0)'high-8) := '0';
end if;
if (Finite (in1reg3)) then
outarray(0)(outarray(0)'high-9) := '1';
else
outarray(0)(outarray(0)'high-9) := '0';
end if;
if (Isnan (in1reg3)) then
outarray(0)(outarray(0)'high-10) := '1';
else
outarray(0)(outarray(0)'high-10) := '0';
end if;
end if;
end process cmd12reg;
-- purpose "1101" boolean test
cmd13reg: process (clk, rst_n) is
variable tmpcmd : STD_LOGIC_VECTOR (2 downto 0);
variable outarray : cry_type; -- array for output
begin -- process cmd2reg
if rst_n = '0' then -- asynchronous reset (active low)
outx(13) <= ( others => '0');
jrloop: for j in 0 to 7 loop
outarray (j) := (others => '0');
end loop jrloop;
elsif rising_edge(clk) then -- rising clock edge
outx(13) <= outarray(7);
jcloop: for j in 7 downto 1 loop
outarray (j) := outarray(j-1);
end loop jcloop;
tmpcmd := to_slv (in2reg3 (in2reg3'low+2 downto in2reg3'low));
case tmpcmd is
when "000" =>
outarray(0) := not (in1reg3);
when "001" =>
outarray(0) := in1reg3 and in2reg3;
when "010" =>
outarray(0) := in1reg3 or in2reg3;
when "011" =>
outarray(0) := in1reg3 nand in2reg3;
when "100" =>
outarray(0) := in1reg3 nor in2reg3;
when "101" =>
outarray(0) := in1reg3 xor in2reg3;
when "110" =>
outarray(0) := in1reg3 xnor in2reg3;
when "111" =>
outarray(0) := in1reg3 xor '1';
when others => null;
end case;
end if;
end process cmd13reg;
-- purpose "1110" reduce and vector test
cmd14reg: process (clk, rst_n) is
variable tmpcmd : STD_LOGIC_VECTOR (2 downto 0);
variable outarray : cry_type; -- array for output
begin -- process cmd2reg
if rst_n = '0' then -- asynchronous reset (active low)
outx(14) <= ( others => '0');
jrloop: for j in 0 to 7 loop
outarray (j) := (others => '0');
end loop jrloop;
elsif rising_edge(clk) then -- rising clock edge
outx(14) <= outarray(7);
jcloop: for j in 7 downto 1 loop
outarray (j) := outarray(j-1);
end loop jcloop;
tmpcmd := to_slv (in2reg3 (in2reg3'low+2 downto in2reg3'low));
case tmpcmd is
when "000" =>
outarray(0) := (others => '0');
outarray(0)(outarray(0)'high) := and_reduce (in1reg3);
outarray(0)(outarray(0)'high-1) := nand_reduce (in1reg3);
outarray(0)(outarray(0)'high-2) := or_reduce (in1reg3);
outarray(0)(outarray(0)'high-3) := nor_reduce (in1reg3);
outarray(0)(outarray(0)'high-4) := xor_reduce (in1reg3);
outarray(0)(outarray(0)'high-5) := xnor_reduce (in1reg3);
when "001" =>
outarray(0) := in1reg3 and in2reg3(in2reg3'high);
when "010" =>
outarray(0) := in1reg3 or in2reg3(in2reg3'high);
when "011" =>
outarray(0) := in1reg3 nand in2reg3(in2reg3'high);
when "100" =>
outarray(0) := in1reg3 nor in2reg3(in2reg3'high);
when "101" =>
outarray(0) := in2reg3(in2reg3'high) xor in1reg3;
when "110" =>
outarray(0) := in2reg3(in2reg3'high) xnor in1reg3;
when "111" =>
outarray(0) := in2reg3(in2reg3'high) and in1reg3;
when others => null;
end case;
end if;
end process cmd14reg;
-- purpose "1111" + constant
cmd15reg: process (clk, rst_n) is
variable tmpcmd : STD_LOGIC_VECTOR (2 downto 0);
variable outarray : cry_type; -- array for output
begin -- process cmd2reg
if rst_n = '0' then -- asynchronous reset (active low)
outx(15) <= ( others => '0');
jrloop: for j in 0 to 7 loop
outarray (j) := (others => '0');
end loop jrloop;
elsif rising_edge(clk) then -- rising clock edge
outx(15) <= outarray(7);
jcloop: for j in 7 downto 1 loop
outarray (j) := outarray(j-1);
end loop jcloop;
tmpcmd := to_slv (in2reg3 (in2reg3'low+2 downto in2reg3'low));
case tmpcmd is
when "000" =>
outarray(0) := in1reg3 + 1;
when "001" =>
outarray(0) := 1 + in1reg3;
when "010" =>
outarray(0) := in1reg3 + 1.0;
when "011" =>
outarray(0) := 1.0 + in1reg3;
when "100" =>
outarray(0) := in1reg3 * 1;
when "101" =>
outarray(0) := 1 * in1reg3;
when "110" =>
outarray(0) := in1reg3 * 1.0;
when "111" =>
outarray(0) := 1.0 * in1reg3;
when others => null;
end case;
end if;
end process cmd15reg;
-- purpose: multiply floating point
-- type : sequential
-- inputs : clk, rst_n, in1, in2
-- outputs: out1
cmdreg: process (clk, rst_n) is
variable outreg : float32; -- register stages
variable in1reg, in2reg : float32; -- register stages
variable in1reg2, in2reg2 : float32; -- register stages
begin -- process mulreg
if rst_n = '0' then -- asynchronous reset (active low)
in1reg := ( others => '0');
in2reg := ( others => '0');
in1reg2 := ( others => '0');
in2reg2 := ( others => '0');
in1reg3 <= ( others => '0');
in2reg3 <= ( others => '0');
out1 <= ( others => '0');
outreg := (others => '0');
rcloop: for i in 1 to 15 loop
cmdarray (i) <= (others => '0');
end loop rcloop;
elsif rising_edge(clk) then -- rising clock edge
out1 <= to_slv (outreg);
outregc: case cmdarray (13) is
when "0000" => outreg := outx (0);
when "0001" => outreg := outx (1);
when "0010" => outreg := outx (2);
when "0011" => outreg := outx (3);
when "0100" => outreg := outx (4);
when "0101" => outreg := outx (5);
when "0110" => outreg := outx (6);
when "0111" => outreg := outx (7);
when "1000" => outreg := outx (8);
when "1001" => outreg := outx (9);
when "1010" => outreg := outx (10);
when "1011" => outreg := outx (11);
when "1100" => outreg := outx (12);
when "1101" => outreg := outx (13);
when "1110" => outreg := outx (14);
when "1111" => outreg := outx (15);
when others => null;
end case outregc;
cmdpipe: for i in 15 downto 3 loop
cmdarray (i) <= cmdarray (i-1);
end loop cmdpipe;
cmdarray (2) <= std_ulogic_vector(cmd);
in1reg3 <= in1reg2;
in2reg3 <= in2reg2;
in1reg2 := in1reg;
in2reg2 := in2reg;
in1reg := to_float (in1, in1reg);
in2reg := to_float (in2, in2reg);
end if;
end process cmdreg;
end architecture rtl;
@@ -0,0 +1,16 @@
<pre>
Tested with Modeltech 6.5b
When you compile you will get a warning:
(vcom-1246) Range 0 downto 1 is null.
To suppress this warning compile with "-suppress 1236"
In the MTI install you will find a premapped library called
"floatfixlib". This contains an old version of "fixed_pkg" and "float_pkg".
The versions in this release are newer.
To compile: source the "compile.mti" script. This will create the
IEEE_PROPOSED VHDL library.
See the README for an explination of the new functions in these packages.
</pre>
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,478 @@
------------------------------------------------------------------------------
-- "standard_textio_additions" package contains the additions to the built in
-- "standard.textio" package.
-- This package should be compiled into "ieee_proposed" and used as follows:
-- use ieee_proposed.standard_textio_additions.all;
-- Last Modified: $Date: 2007/03/13 18:25:58 $
-- RCS ID: $Id: standard_textio_additions_c.vhdl,v 1.5 2007/03/13 18:25:58 l435385 Exp $
--
-- Created for VHDL-200X par, David Bishop (dbishop@vhdl.org)
------------------------------------------------------------------------------
use std.textio.all;
package standard_textio_additions is
-- procedure DEALLOCATE (P : inout LINE);
procedure FLUSH (file F : TEXT);
function MINIMUM (L, R : SIDE) return SIDE;
function MAXIMUM (L, R : SIDE) return SIDE;
function TO_STRING (VALUE : SIDE) return STRING;
function JUSTIFY (VALUE : STRING; JUSTIFIED : SIDE := right; FIELD : WIDTH := 0) return STRING;
procedure SREAD (L : inout LINE; VALUE : out STRING; STRLEN : out NATURAL);
alias STRING_READ is SREAD [LINE, STRING, NATURAL];
alias BREAD is READ [LINE, BIT_VECTOR, BOOLEAN];
alias BREAD is READ [LINE, BIT_VECTOR];
alias BINARY_READ is READ [LINE, BIT_VECTOR, BOOLEAN];
alias BINARY_READ is READ [LINE, BIT_VECTOR];
procedure OREAD (L : inout LINE; VALUE : out BIT_VECTOR; GOOD : out BOOLEAN);
procedure OREAD (L : inout LINE; VALUE : out BIT_VECTOR);
alias OCTAL_READ is OREAD [LINE, BIT_VECTOR, BOOLEAN];
alias OCTAL_READ is OREAD [LINE, BIT_VECTOR];
procedure HREAD (L : inout LINE; VALUE : out BIT_VECTOR; GOOD : out BOOLEAN);
procedure HREAD (L : inout LINE; VALUE : out BIT_VECTOR);
alias HEX_READ is HREAD [LINE, BIT_VECTOR, BOOLEAN];
alias HEX_READ is HREAD [LINE, BIT_VECTOR];
procedure TEE (file F : TEXT; L : inout LINE);
procedure WRITE (L : inout LINE; VALUE : in REAL;
FORMAT : in STRING);
alias SWRITE is WRITE [LINE, STRING, SIDE, WIDTH];
alias STRING_WRITE is WRITE [LINE, STRING, SIDE, WIDTH];
alias BWRITE is WRITE [LINE, BIT_VECTOR, SIDE, WIDTH];
alias BINARY_WRITE is WRITE [LINE, BIT_VECTOR, SIDE, WIDTH];
procedure OWRITE (L : inout LINE; VALUE : in BIT_VECTOR;
JUSTIFIED : in SIDE := right; FIELD : in WIDTH := 0);
alias OCTAL_WRITE is OWRITE [LINE, BIT_VECTOR, SIDE, WIDTH];
procedure HWRITE (L : inout LINE; VALUE : in BIT_VECTOR;
JUSTIFIED : in SIDE := right; FIELD : in WIDTH := 0);
alias HEX_WRITE is HWRITE [LINE, BIT_VECTOR, SIDE, WIDTH];
end package standard_textio_additions;
library ieee_proposed;
use ieee_proposed.standard_additions.all;
package body standard_textio_additions is
-- pragma synthesis_off
constant NUS : STRING(2 to 1) := (others => ' '); -- NULL array
constant NBSP : CHARACTER := CHARACTER'val(160); -- space character
-- Writes L to a file without modifying the contents of the line
procedure TEE (file F : TEXT; L : inout LINE) is
begin
write (OUTPUT, L.all & LF);
writeline(F, L);
end procedure TEE;
procedure FLUSH (file F: TEXT) is -- Implicit
begin
file_close (F);
end procedure FLUSH;
-- Read and Write procedure for strings
procedure SREAD (L : inout LINE;
VALUE : out STRING;
STRLEN : out natural) is
variable ok : BOOLEAN;
variable c : CHARACTER;
-- Result is padded with space characters
variable result : STRING (1 to VALUE'length) := (others => ' ');
begin
VALUE := result;
loop -- skip white space
read(L, c, ok);
exit when (ok = false) or ((c /= ' ') and (c /= NBSP) and (c /= HT));
end loop;
-- Bail out if there was a bad read
if not ok then
STRLEN := 0;
return;
end if;
result (1) := c;
STRLEN := 1;
for i in 2 to VALUE'length loop
read(L, c, ok);
if (ok = false) or ((c = ' ') or (c = NBSP) or (c = HT)) then
exit;
else
result (i) := c;
end if;
STRLEN := i;
end loop;
VALUE := result;
end procedure SREAD;
-- Hex Read and Write procedures for bit_vector.
-- Procedure only visible internally.
procedure Char2QuadBits (C : CHARACTER;
RESULT : out BIT_VECTOR(3 downto 0);
GOOD : out BOOLEAN;
ISSUE_ERROR : in BOOLEAN) is
begin
case c is
when '0' => result := x"0"; good := true;
when '1' => result := x"1"; good := true;
when '2' => result := x"2"; good := true;
when '3' => result := x"3"; good := true;
when '4' => result := x"4"; good := true;
when '5' => result := x"5"; good := true;
when '6' => result := x"6"; good := true;
when '7' => result := x"7"; good := true;
when '8' => result := x"8"; good := true;
when '9' => result := x"9"; good := true;
when 'A' | 'a' => result := x"A"; good := true;
when 'B' | 'b' => result := x"B"; good := true;
when 'C' | 'c' => result := x"C"; good := true;
when 'D' | 'd' => result := x"D"; good := true;
when 'E' | 'e' => result := x"E"; good := true;
when 'F' | 'f' => result := x"F"; good := true;
when others =>
assert not ISSUE_ERROR report
"TEXTIO.HREAD Error: Read a '" & c &
"', expected a Hex character (0-F)." severity error;
GOOD := false;
end case;
end procedure Char2QuadBits;
procedure HREAD (L : inout LINE;
VALUE : out BIT_VECTOR;
GOOD : out BOOLEAN) is
variable ok : BOOLEAN;
variable c : CHARACTER;
constant ne : INTEGER := (VALUE'length+3)/4;
constant pad : INTEGER := ne*4 - VALUE'length;
variable sv : BIT_VECTOR (0 to ne*4 - 1) := (others => '0');
variable s : STRING(1 to ne-1);
begin
VALUE := (VALUE'range => '0');
loop -- skip white space
read(l, c, ok);
exit when (ok = false) or ((c /= ' ') and (c /= NBSP) and (c /= HT));
end loop;
-- Bail out if there was a bad read
if not ok then
GOOD := false;
return;
end if;
Char2QuadBits(c, sv(0 to 3), ok, false);
if not ok then
GOOD := false;
return;
end if;
read(L, s, ok);
if not ok then
GOOD := false;
return;
end if;
for i in 1 to ne-1 loop
Char2QuadBits(s(i), sv(4*i to 4*i+3), ok, false);
if not ok then
GOOD := false;
return;
end if;
end loop;
if or_reduce (sv (0 to pad-1)) = '1' then
GOOD := false; -- vector was truncated.
else
GOOD := true;
VALUE := sv (pad to sv'high);
end if;
end procedure HREAD;
procedure HREAD (L : inout LINE;
VALUE : out BIT_VECTOR) is
variable ok : BOOLEAN;
variable c : CHARACTER;
constant ne : INTEGER := (VALUE'length+3)/4;
constant pad : INTEGER := ne*4 - VALUE'length;
variable sv : BIT_VECTOR(0 to ne*4 - 1) := (others => '0');
variable s : STRING(1 to ne-1);
begin
VALUE := (VALUE'range => '0');
loop -- skip white space
read(l, c, ok);
exit when (ok = false) or ((c /= ' ') and (c /= NBSP) and (c /= HT));
end loop;
-- Bail out if there was a bad read
if not ok then
report "TEXTIO.HREAD Error: Failed skipping white space"
severity error;
return;
end if;
Char2QuadBits(c, sv(0 to 3), ok, true);
if not ok then
return;
end if;
read(L, s, ok);
if not ok then
report "TEXTIO.HREAD Error: Failed to read the STRING"
severity error;
return;
end if;
for i in 1 to ne-1 loop
Char2QuadBits(s(i), sv(4*i to 4*i+3), ok, true);
if not ok then
return;
end if;
end loop;
if or_reduce (sv (0 to pad-1)) = '1' then
report "TEXTIO.HREAD Error: Vector truncated"
severity error;
else
VALUE := sv (pad to sv'high);
end if;
end procedure HREAD;
procedure HWRITE (L : inout LINE;
VALUE : in BIT_VECTOR;
JUSTIFIED : in SIDE := right;
FIELD : in WIDTH := 0) is
begin
write (L => L,
VALUE => to_hstring(VALUE),
JUSTIFIED => JUSTIFIED,
FIELD => FIELD);
end procedure HWRITE;
-- Procedure only visible internally.
procedure Char2TriBits (C : CHARACTER;
RESULT : out BIT_VECTOR(2 downto 0);
GOOD : out BOOLEAN;
ISSUE_ERROR : in BOOLEAN) is
begin
case c is
when '0' => result := o"0"; good := true;
when '1' => result := o"1"; good := true;
when '2' => result := o"2"; good := true;
when '3' => result := o"3"; good := true;
when '4' => result := o"4"; good := true;
when '5' => result := o"5"; good := true;
when '6' => result := o"6"; good := true;
when '7' => result := o"7"; good := true;
when others =>
assert not ISSUE_ERROR
report
"TEXTIO.OREAD Error: Read a '" & c &
"', expected an Octal character (0-7)."
severity error;
GOOD := false;
end case;
end procedure Char2TriBits;
-- Read and Write procedures for Octal values
procedure OREAD (L : inout LINE;
VALUE : out BIT_VECTOR;
GOOD : out BOOLEAN) is
variable ok : BOOLEAN;
variable c : CHARACTER;
constant ne : INTEGER := (VALUE'length+2)/3;
constant pad : INTEGER := ne*3 - VALUE'length;
variable sv : BIT_VECTOR(0 to ne*3 - 1) := (others => '0');
variable s : STRING(1 to ne-1);
begin
VALUE := (VALUE'range => '0');
loop -- skip white space
read(l, c, ok);
exit when (ok = false) or ((c /= ' ') and (c /= NBSP) and (c /= HT));
end loop;
-- Bail out if there was a bad read
if not ok then
GOOD := false;
return;
end if;
Char2TriBits(c, sv(0 to 2), ok, false);
if not ok then
GOOD := false;
return;
end if;
read(L, s, ok);
if not ok then
GOOD := false;
return;
end if;
for i in 1 to ne-1 loop
Char2TriBits(s(i), sv(3*i to 3*i+2), ok, false);
if not ok then
GOOD := false;
return;
end if;
end loop;
if or_reduce (sv (0 to pad-1)) = '1' then
GOOD := false; -- vector was truncated.
else
GOOD := true;
VALUE := sv (pad to sv'high);
end if;
end procedure OREAD;
procedure OREAD (L : inout LINE;
VALUE : out BIT_VECTOR) is
variable c : CHARACTER;
variable ok : BOOLEAN;
constant ne : INTEGER := (VALUE'length+2)/3;
constant pad : INTEGER := ne*3 - VALUE'length;
variable sv : BIT_VECTOR(0 to ne*3 - 1) := (others => '0');
variable s : STRING(1 to ne-1);
begin
VALUE := (VALUE'range => '0');
loop -- skip white space
read(l, c, ok);
exit when (ok = false) or ((c /= ' ') and (c /= NBSP) and (c /= HT));
end loop;
-- Bail out if there was a bad read
if not ok then
report "TEXTIO.OREAD Error: Failed skipping white space"
severity error;
return;
end if;
Char2TriBits(c, sv(0 to 2), ok, true);
if not ok then
return;
end if;
read(L, s, ok);
if not ok then
report "TEXTIO.OREAD Error: Failed to read the STRING"
severity error;
return;
end if;
for i in 1 to ne-1 loop
Char2TriBits(s(i), sv(3*i to 3*i+2), ok, true);
if not ok then
return;
end if;
end loop;
if or_reduce (sv (0 to pad-1)) = '1' then
report "TEXTIO.OREAD Error: Vector truncated"
severity error;
else
VALUE := sv (pad to sv'high);
end if;
end procedure OREAD;
procedure OWRITE (L : inout LINE;
VALUE : in BIT_VECTOR;
JUSTIFIED : in SIDE := right;
FIELD : in WIDTH := 0) is
begin
write (L => L,
VALUE => to_ostring(VALUE),
JUSTIFIED => JUSTIFIED,
FIELD => FIELD);
end procedure OWRITE;
-- read and write for vector versions
-- These versions produce "value1, value2, value3 ...."
procedure read (L : inout LINE;
VALUE : out boolean_vector;
GOOD : out BOOLEAN) is
variable dummy : CHARACTER;
variable igood : BOOLEAN := true;
begin
for i in VALUE'range loop
read (L => L,
VALUE => VALUE(i),
GOOD => igood);
if (igood) and (i /= value'right) then
read (L => L,
VALUE => dummy, -- Toss the comma or seperator
good => igood);
end if;
if (not igood) then
good := false;
return;
end if;
end loop;
good := true;
end procedure read;
procedure read (L : inout LINE;
VALUE : out boolean_vector) is
variable dummy : CHARACTER;
variable igood : BOOLEAN;
begin
for i in VALUE'range loop
read (L => L,
VALUE => VALUE(i),
good => igood);
if (igood) and (i /= value'right) then
read (L => L,
VALUE => dummy, -- Toss the comma or seperator
good => igood);
end if;
if (not igood) then
report "STANDARD.STD_TEXTIO(BOOLEAN_VECTOR) "
& "Read error ecounted during vector read" severity error;
return;
end if;
end loop;
end procedure read;
procedure write (L : inout LINE;
VALUE : in boolean_vector;
JUSTIFIED : in SIDE := right;
FIELD : in WIDTH := 0) is
begin
for i in VALUE'range loop
write (L => L,
VALUE => VALUE(i),
JUSTIFIED => JUSTIFIED,
FIELD => FIELD);
if (i /= value'right) then
swrite (L, ", ");
end if;
end loop;
end procedure write;
procedure WRITE (L: inout LINE; VALUE: in REAL;
FORMAT: in STRING) is
begin
swrite ( L => L,
VALUE => to_string (VALUE, FORMAT));
end procedure WRITE;
function justify (
value : STRING;
justified : SIDE := right;
field : width := 0)
return STRING is
constant VAL_LEN : INTEGER := value'length;
variable result : STRING (1 to field) := (others => ' ');
begin -- function justify
-- return value if field is too small
if VAL_LEN >= field then
return value;
end if;
if justified = left then
result(1 to VAL_LEN) := value;
elsif justified = right then
result(field - VAL_LEN + 1 to field) := value;
end if;
return result;
end function justify;
function to_string (
VALUE : SIDE) return STRING is
begin
return SIDE'image(VALUE);
end function to_string;
-- pragma synthesis_on
-- Will be implicit
function minimum (L, R : SIDE) return SIDE is
begin
if L > R then return R;
else return L;
end if;
end function minimum;
function maximum (L, R : SIDE) return SIDE is
begin
if L > R then return L;
else return R;
end if;
end function maximum;
end package body standard_textio_additions;
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,439 @@
-- Test vectors for the synthesis test for the fixed point math package
-- This test is designed to test fixed_synth and exercise much of the entity.
-- Created for vhdl-200x by David Bishop (dbishop@vhdl.org)
-- --------------------------------------------------------------------
-- modification history : Last Modified $Date: 2006-06-08 10:55:54-04 $
-- Version $Id: test_fixed_synth.vhdl,v 1.1 2006-06-08 10:55:54-04 l435385 Exp $
-- --------------------------------------------------------------------
entity test_fixed_synth is
generic (
quiet : boolean := false); -- make the simulation quiet
end entity test_fixed_synth;
library ieee, ieee_proposed;
use ieee.std_logic_1164.all;
use ieee.numeric_std.all;
use ieee_proposed.fixed_pkg.all;
architecture testbench of test_fixed_synth is
procedure report_error (
constant errmes : in string; -- error message
actual : in sfixed; -- data from algorithm
constant expected : in sfixed) is -- reference data
begin -- function report_error
assert actual = expected
report errmes & CR
& "Actual: " & to_string(actual)
& " (" & real'image(to_real(actual)) & ")" & CR
& " /= " & to_string(expected)
& " (" & real'image(to_real(expected)) & ")"
severity error;
return;
end procedure report_error;
-- Device under test. Note that all inputs and outputs are std_logic_vector.
-- This entity can be use both pre and post synthesis.
component fixed_synth is
port (
in1, in2 : in std_logic_vector (15 downto 0); -- inputs
out1 : out std_logic_vector (15 downto 0); -- output
cmd : in std_logic_vector (3 downto 0);
clk, rst_n : in std_ulogic); -- clk and reset
end component fixed_synth;
constant clock_period : time := 500 ns; -- clock period
subtype sfixed7 is sfixed (3 downto -3); -- 7 bit
subtype sfixed16 is sfixed (7 downto -8); -- 16 bit
signal stop_clock : boolean := false; -- stop the clock
signal clk, rst_n : std_ulogic; -- clk and reset
signal in1slv, in2slv, out1slv : std_logic_vector(15 downto 0);
signal in1, in2 : sfixed16; -- inputs
signal out1 : sfixed16; -- output
signal cmd : std_logic_vector (3 downto 0); -- command string
begin -- architecture testbench
-- From fixed point to Std_logic_vector
in1slv <= to_slv(in1);
in2slv <= to_slv(in2);
-- Std_logic_vector to fixed point.
out1 <= to_sfixed(out1slv, out1'high, out1'low);
DUT: fixed_synth
port map (
in1 => in1slv, -- [in std_logic_vector (15 downto 0)] inputs
in2 => in2slv, -- [in std_logic_vector (15 downto 0)] inputs
out1 => out1slv, -- [out std_logic_vector (15 downto 0)] output
cmd => cmd, -- [in std_logic_vector (2 downto 0)]
clk => clk, -- [in std_ulogic] clk and reset
rst_n => rst_n); -- [in std_ulogic] clk and reset
-- purpose: clock driver
clkprc: process is
begin -- process clkprc
if (not stop_clock) then
clk <= '0';
wait for clock_period/2.0;
clk <= '1';
wait for clock_period/2.0;
else
wait;
end if;
end process clkprc;
-- purpose: reset driver
reset_proc: process is
begin -- process reset_proc
rst_n <= '0';
wait for clock_period * 2.0;
rst_n <= '1';
wait;
end process reset_proc;
-- purpose: main test loop
tester: process is
begin -- process tester
cmd <= "0000"; -- add mode
in1 <= (others => '0');
in2 <= (others => '0');
wait for clock_period;
wait for clock_period;
wait for clock_period;
wait for clock_period;
in1 <= "0000011010000000"; -- 6.5
in2 <= "0000001100000000"; -- 3
wait for clock_period;
cmd <= "0001"; -- subtract mode
in1 <= "0000011010000000"; -- 6.5
in2 <= "0000001100000000"; -- 3
wait for clock_period;
cmd <= "0010"; -- multiply mode
in1 <= "0000011010000000"; -- 6.5
in2 <= "0000001100000000"; -- 3
wait for clock_period;
cmd <= "0000"; -- add mode
in1 <= "0000000010000000"; -- 0.5
in2 <= "0000000010000000"; -- 0.5
wait for clock_period;
in1 <= to_sfixed (3.14, sfixed16'high, sfixed16'low);
in2 <= "0000001100000000"; -- 3
wait for clock_period;
cmd <= "0011"; -- divide
in1 <= "0000000010000000"; -- 0.5
in2 <= "0000000010000000"; -- 0.5
wait for clock_period;
in1 <= to_sfixed (-0.5, sfixed16'high, sfixed16'low); -- -0.5
in2 <= "0000000010000000"; -- 0.5
wait for clock_period;
cmd <= "0100"; -- unsigned add
in1 <= "0000011010000000"; -- 6.5
in2 <= "0000001100000000"; -- 3
wait for clock_period;
cmd <= "0101"; -- subtract mode
in1 <= "0000011010000000"; -- 6.5
in2 <= "0000001100000000"; -- 3
wait for clock_period;
cmd <= "0110"; -- multiply mode
in1 <= "0000011010000000"; -- 6.5
in2 <= "0000001100000000"; -- 3
wait for clock_period;
cmd <= "0100"; -- add mode
in1 <= "0000000010000000"; -- 0.5
in2 <= "0000000010000000"; -- 0.5
wait for clock_period;
in1 <= to_sfixed (3.14, sfixed16'high, sfixed16'low);
in2 <= "0000001100000000"; -- 3
wait for clock_period;
cmd <= "0111"; -- divide
in1 <= "0000000010000000"; -- 0.5
in2 <= "0000000010000000"; -- 0.5
wait for clock_period;
in1 <= to_sfixed (6.5, sfixed16'high, sfixed16'low); -- 6.5
in2 <= "0000000010000000"; -- 0.5
wait for clock_period;
-- resize
cmd <= "1000";
in1 <= to_sfixed (5.25, in1);
in2 <= to_sfixed (-5.25, in2);
wait for clock_period;
in1 <= to_sfixed (21.125, in1);
in2 <= to_sfixed (21.125, in2);
wait for clock_period;
in2 <= (in2'high => '0', in2'high-1 => '0', others => '0');
cmd <= "1001"; -- SIGNED
in1 <= to_sfixed (6.25, in1);
wait for clock_period;
in2 <= (in2'high => '0', in2'high-1 => '1', others => '0');
cmd <= "1001"; -- UNSIGNED
in1 <= to_sfixed (7.25, in1);
wait for clock_period;
in2 <= (in2'high => '1', in2'high-1 => '0', others => '0');
cmd <= "1001"; -- SIGNED
in1 <= to_sfixed (6.25, in1);
wait for clock_period;
in2 <= (in2'high => '1', in2'high-1 => '1', others => '0');
cmd <= "1001"; -- UNSIGNED
in1 <= to_sfixed (7.25, in1);
wait for clock_period;
cmd <= "1010";
in2 <= (in2'high => '0', in2'high-1 => '0', others => '0');
in1 <= to_sfixed (3, in1);
wait for clock_period;
cmd <= "1010";
in2 <= (in2'high => '0', in2'high-1 => '1', others => '0');
in1 <= to_sfixed (5, in1);
wait for clock_period;
cmd <= "1010";
in2 <= (in2'high => '1', in2'high-1 => '0', others => '0');
in1 <= to_sfixed (-5.5, in1);
wait for clock_period;
cmd <= "1010";
in2 <= (in2'high => '1', in2'high-1 => '1', others => '0');
in1 <= to_sfixed (7.25, in1);
wait for clock_period;
cmd <= "1010"; -- abs (mod)
in2 <= (in2'high => '1', in2'high-1 => '0', others => '0');
in1 <= to_sfixed (-42, in1);
wait for clock_period;
cmd <= "1011"; -- mod
in1 <= to_sfixed (6.25, in1);
in2 <= to_sfixed (6, in2);
wait for clock_period;
cmd <= "1100"; -- REM
in1 <= to_sfixed (6.25, in1);
in2 <= to_sfixed (6, in2);
wait for clock_period;
cmd <= "1101"; -- srl
in1 <= to_sfixed (5.25, in1);
in2 <= to_sfixed (-1, in2);
wait for clock_period;
cmd <= "1110"; -- sra
in1 <= to_sfixed (-7.25, in1);
in2 <= to_sfixed (1, in2);
wait for clock_period;
cmd <= "1111"; -- compare
in1 <= to_sfixed (42, in1);
in2 <= to_sfixed (42, in1);
wait for clock_period;
in1 <= to_sfixed (45, in1);
in2 <= to_sfixed (90, in1);
wait for clock_period;
in1 <= to_sfixed (3.125, in1);
in2 <= (others => '0');
wait for clock_period;
in1 <= "0110111110101111";
in2 <= "1111111111111111";
wait for clock_period;
in1 <= (others => '0');
in2 <= (others => '0');
wait for clock_period;
in1 <= "0000111000000000";
in2 <= "0000111000000000";
wait for clock_period;
in1 <= (others => '1');
in2 <= (others => '1');
wait for clock_period;
wait for clock_period;
wait for clock_period;
cmd <= "0000"; -- add mode
in1 <= (others => '0');
in2 <= (others => '0');
wait for clock_period;
wait for clock_period;
wait for clock_period;
wait for clock_period;
wait for clock_period;
wait for clock_period;
wait for clock_period;
wait for clock_period;
wait;
end process tester;
-- purpose: check the output of the tester
-- type : combinational
-- inputs :
-- outputs:
checktest: process is
constant fxzero : sfixed16 := (others => '0'); -- zero
variable chks16 : sfixed16; -- variable
variable sm1, sm2 : sfixed7; -- small fixed point
begin -- process checktest
wait for clock_period/2.0;
wait for clock_period;
wait for clock_period;
waitloop: while (out1 = fxzero) loop
wait for clock_period;
end loop waitloop;
chks16 := to_sfixed ((3.0+6.5), sfixed16'high, sfixed16'low);
report_error ( "3.0 + 6.5 error",
out1,
chks16);
wait for clock_period;
chks16 := to_sfixed ((6.5 - 3.0), sfixed16'high, sfixed16'low);
report_error ( "6.5 - 3.0 error",
out1,
chks16);
wait for clock_period;
chks16 := to_sfixed ((6.5 * 3.0), sfixed16'high, sfixed16'low);
report_error ( "6.5 * 3.0 error",
out1,
chks16);
wait for clock_period;
chks16 := to_sfixed (1, sfixed16'high, sfixed16'low);
report_error ( "0.5 + 0.5 error",
out1,
chks16);
wait for clock_period;
chks16 := to_sfixed (6.14, sfixed16'high, sfixed16'low);
report_error ( "3.14 + 3 error",
out1,
chks16);
wait for clock_period;
chks16 := "0000000100000000";
report_error ( "0.5/0.5 error",
out1,
chks16);
wait for clock_period;
chks16 := to_sfixed (-1, sfixed16'high, sfixed16'low);
report_error ( "-0.5/0.5 error",
out1,
chks16);
wait for clock_period;
chks16 := to_sfixed ((3.0+6.5), sfixed16'high, sfixed16'low);
report_error ( "3.0 + 6.5 error",
out1,
chks16);
wait for clock_period;
chks16 := to_sfixed ((6.5 - 3.0), sfixed16'high, sfixed16'low);
report_error ( "6.5 - 3.0 error",
out1,
chks16);
wait for clock_period;
chks16 := to_sfixed ((6.5 * 3.0), sfixed16'high, sfixed16'low);
report_error ( "6.5 * 3.0 error",
out1,
chks16);
wait for clock_period;
chks16 := to_sfixed (1, sfixed16'high, sfixed16'low);
report_error ( "0.5 + 0.5 error",
out1,
chks16);
wait for clock_period;
chks16 := to_sfixed (6.14, sfixed16'high, sfixed16'low);
report_error ( "3.14 + 3 error",
out1,
chks16);
wait for clock_period;
chks16 := "0000000100000000";
report_error ( "0.5/0.5 error",
out1,
chks16);
wait for clock_period;
chks16 := to_sfixed (13, sfixed16'high, sfixed16'low);
report_error ( "6.5/0.5 error",
out1,
chks16);
wait for clock_period;
-- resize test
sm1 := out1 (7 downto 1);
sm2 := to_sfixed (5.25, sm2);
report_error ( "resize 1 error", sm1, sm2);
sm1 := out1 (-1 downto -7);
sm2 := to_sfixed (-5.25, sm2);
report_error ( "resize 2 error", sm1, sm2);
wait for clock_period;
sm1 := out1 (7 downto 1);
sm2 := "0101001"; -- wrapped
-- sm2 := to_sfixed (21.125, sm2, 0, false, false); -- wrap, no round
report_error ( "resize 1 error", sm1, sm2);
sm1 := out1 (-1 downto -7);
sm2 := "0111111"; -- saturate
report_error ( "resize 2 error", sm1, sm2);
wait for clock_period;
-- to_signed and back
report_error ("to_signed(6.25)", out1, to_sfixed (6, out1));
wait for clock_period;
-- to_unsigned and back
report_error ("to_unsigned(7.25)", out1, to_sfixed (7, out1));
wait for clock_period;
-- to_integer and back
report_error ("to_signed(6.25)", out1, to_sfixed (6, out1));
wait for clock_period;
-- to_integer(ufixed) and back
report_error ("to_unsigned(7.25)", out1, to_sfixed (7, out1));
wait for clock_period;
report_error ("1/3", out1, to_sfixed (1.0/3.0, out1'high, -7));
wait for clock_period;
report_error ("unsigned 1/5", out1, to_sfixed (1.0/5.0, out1));
wait for clock_period;
report_error ("abs (-5.5)", out1, to_sfixed (5.5, out1));
wait for clock_period;
report_error ("-7.25", out1, to_sfixed (-7.25, out1));
wait for clock_period;
report_error ("abs(-42)", out1, to_sfixed (42, out1));
wait for clock_period;
report_error ("6.25 mod 6", out1, to_sfixed (0.25, out1));
wait for clock_period;
report_error ("6.25 rem 6", out1, to_sfixed (0.25, out1));
wait for clock_period;
chks16 := "0000101010000000";
report_error ("5.25 srl -1", out1, chks16);
wait for clock_period;
chks16 := "1111110001100000";
report_error ("-7.25 sra 1", out1, chks16);
wait for clock_period;
-- 7654321012345678
chks16 := "0111000000110001";
assert (std_match (out1, chks16))
report "42=42 compare " & CR
& "Actual " & to_string(out1) & CR
& "Expected " & to_string(chks16) severity error;
wait for clock_period;
chks16 := "------0001010110";
assert (std_match (out1, chks16))
report "45=90 compare " & CR
& "Actual " & to_string(out1) & CR
& "Expected " & to_string(chks16) severity error;
wait for clock_period;
chks16 := "------1010101010";
assert (std_match (out1, chks16))
report "3.125=0 compare " & CR
& "Actual " & to_string(out1) & CR
& "Expected " & to_string(chks16) severity error;
wait for clock_period;
-- 7654321012345678
chks16 := "0--1010000101010";
assert (std_match (out1, chks16))
report "pattern1 compare " & CR
& "Actual " & to_string(out1) & CR
& "Expected " & to_string(chks16) severity error;
wait for clock_period;
-- 7654321012345678
chks16 := "0001100000110001";
assert (std_match (out1, chks16))
report "zero = zero " & CR
& "Actual " & to_string(out1) & CR
& "Expected " & to_string(chks16) severity error;
wait for clock_period;
-- 7654321012345678
chks16 := "1111000000110001";
assert (std_match (out1, chks16))
report "pattern2 compare " & CR
& "Actual " & to_string(out1) & CR
& "Expected " & to_string(chks16) severity error;
wait for clock_period;
-- 7654321012345678
chks16 := "0111000000110001";
assert (std_match (out1, chks16))
report "-1 = -1 " & CR
& "Actual " & to_string(out1) & CR
& "Expected " & to_string(chks16) severity error;
wait for clock_period;
wait for clock_period;
wait for clock_period;
wait for clock_period;
wait for clock_period;
assert (false) report "Testing complete" severity note;
stop_clock <= true;
wait;
end process checktest;
end architecture testbench;
@@ -0,0 +1,892 @@
-------------------------------------------------------------------------------
-- test routine for the post synthesis 32 bit multiply
-------------------------------------------------------------------------------
entity test_float_synth is
generic (
quiet : BOOLEAN := false);
end entity test_float_synth;
use std.textio.all;
library ieee, ieee_proposed;
use ieee.math_real.all;
use ieee.std_logic_1164.all;
use ieee.numeric_std.all;
use ieee_proposed.fixed_float_types.all;
use ieee_proposed.fixed_pkg.all;
use ieee_proposed.float_pkg.all;
--library modelsim_lib;
--use modelsim_lib.util.all;
architecture testbench of test_float_synth is
subtype fp16 is float (6 downto -9); -- 16 bit
function reverse (
inpvec : STD_LOGIC_VECTOR (0 to 31))
return float32 is
variable result : float32;
begin
for i in 0 to 31 loop
result (i-23) := inpvec(i);
end loop; -- i
return result;
end function reverse;
-- purpose: converts an float32 into a std_logic_vector
-- function to_slv (
-- input : float32) -- float32 input
-- return std_logic_vector is
-- variable result : std_logic_vector (31 downto 0); -- result
-- begin -- function to_slv
-- floop: for i in float32'range loop
-- result (i + fp_fraction_width) := input (i);
-- end loop floop;
-- return result;
-- end function to_slv;
-- purpose: converts a std_logic_vector to an float32
function to_float32x (
signal input : STD_LOGIC_VECTOR (31 downto 0))
return float32 is
variable result : float32;
begin -- function to_float32x
return to_float (input, float32'high, -float32'low);
end function to_float32x;
procedure report_error (
constant errmes : STRING; -- error message
actual : in float32; -- data from algorithm
constant expected : float32) is -- reference data
begin -- function report_error
assert actual = expected
report errmes & " miscompare" & CR &
"Actual " & to_string (actual) & " ("
& REAL'image(to_real(actual))& ") /= " & CR &
"Expected " & to_string (expected) & " ("
& REAL'image(to_real(expected))& ")"
severity error;
return;
end procedure report_error;
procedure report_error16 (
constant errmes : STRING; -- error message
actual : in fp16; -- data from algorithm
constant expected : fp16) is -- reference data
begin -- function report_error
assert actual = expected
report errmes & " miscompare" & CR &
"Actual " & to_string (actual) & " ("
& REAL'image(to_real(actual))& ") /= " & CR &
"Expected " & to_string (expected) & " ("
& REAL'image(to_real(expected))& ")"
severity error;
return;
end procedure report_error16;
component float_synth is
port (
in1, in2 : in STD_LOGIC_VECTOR(31 downto 0); -- inputs
out1 : out STD_LOGIC_VECTOR(31 downto 0); -- output
cmd : in STD_LOGIC_VECTOR (3 downto 0);
clk, rst_n : in STD_ULOGIC); -- clk and reset
end component float_synth;
for all : float_synth
use entity work.float_synth(rtl);
constant clock_period : TIME := 500 ns; -- clock period
signal stop_clock : BOOLEAN := false; -- stop the clock
signal out1real : REAL; -- real version
signal in1, in2 : float32; -- inputs
signal out1 : float32; -- output
constant zero0 : float32 := (others => '0'); -- zero
signal cmd : STD_LOGIC_VECTOR (3 downto 0); -- command
signal clk, rst_n : STD_ULOGIC; -- clk and reset
signal in1slv, in2slv, out1slv : STD_LOGIC_VECTOR(31 downto 0);
signal indelay : float32; -- spied signal
begin -- architecture testbench
out1real <= to_real (out1);
in1slv <= to_slv(in1);
in2slv <= to_slv(in2);
out1 <= to_float32x(out1slv);
DUT : float_synth
port map (
in1 => in1slv, -- [in float32] inputs
in2 => in2slv, -- [in float32] inputs
out1 => out1slv, -- [out float32] output
cmd => cmd,
clk => clk, -- [in std_ulogic] clk and reset
rst_n => rst_n); -- [in std_ulogic] clk and reset
-- spy_process : process
-- begin
-- signal_force ("/DUT/in2reg3", "00000000000000000000000000000000",
-- 500 ns, freeze, 5000 ns, 1);
-- wait;
-- end process spy_process;
-- purpose: clock driver
-- type : combinational
-- inputs :
-- outputs:
clkprc : process is
begin -- process clkprc
if (not stop_clock) then
clk <= '0';
wait for clock_period/2.0;
clk <= '1';
wait for clock_period/2.0;
else
wait;
end if;
end process clkprc;
-- purpose: reset driver
-- type : combinational
-- inputs :
-- outputs:
reset_proc : process is
begin -- process reset_proc
rst_n <= '0';
wait for clock_period * 2.0;
rst_n <= '1';
wait;
end process reset_proc;
-- purpose: main test loop
-- type : combinational
-- inputs :
-- outputs:
tester : process is
begin -- process tester
cmd <= "0110"; -- 16 bit to float32 mode
in1 <= "10000000000000000000001000101111"; -- 4.33 ufixed
in2 <= "00000000000000000000000000000100"; -- 4
floop1: for i in 1 to 100 loop
wait for clock_period;
end loop floop1;
cmd <= "0110"; -- 16 bit to float32 mode
in1 <= "10000000000000000000001000101011"; -- 4.33 ufixed
in2 <= "00000000000000000000000000000100"; -- 4
floop2: for i in 1 to 100 loop
wait for clock_period;
end loop floop2;
cmd <= "0010";
in1 <= reverse("00000000000000000000101100000010"); -- 6.5
in2 <= reverse("00000000000000000001010001000010"); -- 42
wait for clock_period;
in1 <= reverse("00000000000000000001010001000010"); -- 42
in2 <= reverse("00000000000000000000101100000010"); -- 6.5
wait for clock_period;
in1 <= reverse("00000000000000000000101100000010"); -- 6.5
in2 <= reverse("00000000000000000000101100000010"); -- 6.5
wait for clock_period;
in1 <= reverse("00000000000000000001010001000010"); -- 42
in2 <= "01000000000000000000000000000000"; -- 2
wait for clock_period;
in1 <= "00111110101010101010101010101011"; -- 1/3
in2 <= "01000000000000000000000000000000"; -- 2
wait for clock_period;
in1 <= reverse("00000000000000000001010001000010"); -- 42
in2 <= reverse("00000000000000000000101100000011"); -- -6.5
wait for clock_period;
in1 <= reverse("10000000000000000000000000000000"); -- 2**-149
in2 <= "11000000000000000000000000000000"; -- -2.0
wait for clock_period;
in1 <= reverse("00000000000000000000001000000000"); -- 2**-127
in2 <= "00111110100000000000000000000000"; -- 0.25
wait for clock_period;
in1 <= reverse("00000000000000000001010001000010"); -- 42
in2 <= reverse("00000000000000000000101100000010"); -- 6.5
wait for clock_period;
cmd <= "0001"; -- subtract mode
in2 <= "01001011111001110011000110011011"; -- 30303030
in1 <= "01001011111001110011000110011100"; -- 30303033
wait for clock_period;
in1 <= reverse("00000000000000000000101100000010"); -- 6.5
in2 <= "01000000100000000000000000000000"; -- 4
wait for clock_period;
in2 <= reverse("00000000000000000000101100000010"); -- 6.5
in1 <= "01000000100000000000000000000000"; -- 4
wait for clock_period;
in1 <= "01000000100010101010101010101011"; -- 4.333333
in2 <= "00111110101010101010101010101011"; -- 1/3
wait for clock_period;
cmd <= "0000"; -- add mode
in1 <= "00111110101010101010101010101011"; -- 1/3
in2 <= "01000000000000000000000000000000"; -- 2
wait for clock_period;
in2 <= "00111110101010101010101010101011"; -- 1/3
in1 <= "01000000000000000000000000000000"; -- 2
wait for clock_period;
in1 <= "00000000100000000000000000000001"; -- 2**-126
in2 <= "01000000100000000000000000000001"; -- 4+
wait for clock_period;
cmd <= "0011"; -- divide mode
in1 <= "00111111100000000000000000000000"; -- 1.0
in2 <= "01000000010000000000000000000000"; -- 3.0
wait for clock_period;
in1 <= "01001100000011001011110001001111"; -- 36892987
in2 <= "00000000010000000000000000000000"; -- 2**-127
wait for clock_period;
in1 <= "10111110101010101010101010101011"; -- -1/3
in2 <= "01000000000000000000000000000000"; -- 2
wait for clock_period;
cmd <= "0100"; -- 32 to 16 conversion mode
in1 <= "00111111100000000000000000000000"; -- 1.0
in2 <= (others => '0');
wait for clock_period;
in1 <= "10111110101010101010101010101011"; -- -1/3, no round
wait for clock_period;
in1 <= "10111110101010101010101010101011"; -- -1/3
in2 <= "00000000000000000000000000000001"; -- opcode 1
wait for clock_period;
cmd <= "0101"; -- conversion mode
in1 <= "00111111100000000000000000000000"; -- 1.0
in2 <= "01000000000000000000000000000000"; -- opcode zero
wait for clock_period;
in1 <= "01000010001010000000000000000000"; -- 42.0
in2 <= "00000000000000000000000000000001"; -- opcode 1
wait for clock_period;
in1 <= "10111111100000000000000000000000"; -- -1.0
in2 <= "00000000000000000000000000000010"; -- 2
wait for clock_period;
in1 <= "00111111100000000000000000000000"; -- 1.0
in2 <= "00000000000000000000000000000011"; -- 3
wait for clock_period;
in1 <= "01000000100010101010101010101011"; -- 4.333333
in2 <= "00000000000000000000000000000100"; -- 4
wait for clock_period;
in1 <= "00111111100000000000000000000000"; -- 1.0
in2 <= "00000000000000000000000000000101"; -- 5
wait for clock_period;
in1 <= "11000000100010101010101010101011"; -- -4.333333
in2 <= "00000000000000000000000000000110"; -- 6 to_sfixed
wait for clock_period;
in1 <= "00111111100000000000000000000000"; -- 1.0
in2 <= "00000000000000000000000000000111"; -- 7 to_sfixed
wait for clock_period;
cmd <= "0110"; -- 16 bit to float32 mode
in1 <= "00000000000000000000000000000011"; -- 3
in2 <= "01000000000000000000000000000000"; -- mode 0
wait for clock_period;
in1 <= "00000000000000000000000000000100"; -- 4
in2 <= "01000000000000000000000000000001"; -- 1
wait for clock_period;
in1 <= "00000000000000001111111111111110"; -- -2
in2 <= "01000000000000000000000000000010"; -- 2 to_float(signed)
wait for clock_period;
in1 <= "00000000000000000000000000000100"; -- 4
in2 <= "01000000000000000000000000000011"; -- mode 3
wait for clock_period;
in1 <= "10000000000000000000001000101011"; -- 4.33 ufixed
in2 <= "00000000000000000000000000000100"; -- 4
wait for clock_period;
in1 <= "10100000000000000000000010000000"; -- 1.0 ufixed
in2 <= "00000000000000000000000000000101"; -- 5
wait for clock_period;
in1 <= "11000000000000001111110111010101"; -- -4.333 sfixed
in2 <= "00000000000000000000000000000110"; -- 6
wait for clock_period;
in1 <= "10100000000000000000000010000000"; -- 1.0 sfixed
in2 <= "00000000000000000000000000000111"; -- 7
wait for clock_period;
cmd <= "0111"; -- Mod
in1 <= "00000000000000000000000000000011"; --
in2 <= "00000000000000000000000000000011"; --
wait for clock_period;
in1 <= "00000010001100101111000100111011"; -- 36892987
in2 <= "00000010001100101111000100111011"; -- 36892987
wait for clock_period;
in1 <= "11000000100010101010101010101011"; -- -4.333333
in2 <= "01000000100000000000000000000000"; -- 4
wait for clock_period;
cmd <= "1000"; -- rem
in1 <= "00000000000000000000000000000011"; --
in2 <= "00000000000000000000000000000011"; --
wait for clock_period;
in1 <= "00000010001100101111000100111011"; -- 36892987
in2 <= "00000010001100101111000100111011"; -- 36892987
wait for clock_period;
in1 <= "11000000100010101010101010101011"; -- -4.333333
in2 <= "01000000100000000000000000000000"; -- 4
wait for clock_period;
cmd <= "1001"; -- constants conversion
in2 <= "11000000000000000000000000000000"; -- command 0
wait for clock_period;
in2 <= "11000000000000000000000000000001"; -- command 1
wait for clock_period;
in2 <= "11000000000000000000000000000010"; -- command 2
wait for clock_period;
in2 <= "11000000000000000000000000000011"; -- command 3
wait for clock_period;
in2 <= "11000000000000000000000000000100"; -- command 4
wait for clock_period;
in2 <= "11000000000000000000000000000101"; -- command 5
wait for clock_period;
in2 <= "11000000000000000000000000000110"; -- command 6
wait for clock_period;
in2 <= "11000000000000000000000000000111"; -- command 7
wait for clock_period;
cmd <= "1010"; -- conversions
in1 <= to_float (1, in1);
in2 <= "11000000000000000000000000000000"; -- command 0
wait for clock_period;
in1 <= to_float (-2, in1);
wait for clock_period;
in2 <= "11000000000000000000000000000001"; -- command 1
wait for clock_period;
in1 <= to_float (1, in1);
wait for clock_period;
in2 <= "00010000000000000000000000000010"; -- command 2 scalb
in1 <= to_float (1, in1);
wait for clock_period;
in2 <= "11110000000000000000000000000010"; -- command 2 scalb
in1 <= to_float (1, in1);
wait for clock_period;
in2 <= "11000000000000000000000000000011"; -- command 3 logb
in1 <= to_float (1, in1);
wait for clock_period;
in2 <= "11000000000000000000000000000011"; -- command 3 logb
in1 <= to_float (0.25, in1);
wait for clock_period;
in2 <= "11000000000000000000000000000100"; -- 4 nextafter
in1 <= to_float (1, in1);
wait for clock_period;
in1 <= to_float (4, in1);
wait for clock_period;
in2 <= "11000000000000000000000000000101"; -- 5 nextafter
in1 <= to_float (1, in1);
wait for clock_period;
in1 <= to_float (-4, in1);
wait for clock_period;
in2 <= "11000000000000000000000000000110"; -- 6 nextafter
in1 <= to_float (1, in1);
wait for clock_period;
in1 <= to_float (4, in1);
wait for clock_period;
in2 <= "11000000000000000000000000000111"; -- 7 nextafter
in1 <= to_float (1, in1);
wait for clock_period;
in1 <= to_float (-4, in1);
wait for clock_period;
cmd <= "1011"; -- copy sign
in1 <= to_float (2, in1);
in2 <= to_float (2, in1);
wait for clock_period;
in1 <= to_float (-3, in1);
in2 <= to_float (3, in1);
wait for clock_period;
in1 <= to_float (4, in1);
in2 <= to_float (-4, in1);
wait for clock_period;
in1 <= to_float (-5, in1);
in2 <= to_float (-5, in1);
wait for clock_period;
cmd <= "1100"; -- compare test
in1 <= to_float (15, in1);
in2 <= to_float (15, in1);
wait for clock_period;
in1 <= to_float (15.5, in1);
in2 <= to_float (-2, in1);
wait for clock_period;
in1 <= to_float (-2, in1);
in2 <= to_float (2, in1);
wait for clock_period;
in1 <= "01111111100000000000000000000000"; -- + inf
in2 <= to_float (-2, in1);
wait for clock_period;
in1 <= "01111111100000000000000000000001"; -- NAN
in2 <= to_float (-2, in1);
wait for clock_period;
cmd <= "1101"; -- boolean test
in1 <= "01111111100000000000000000000000"; -- + inf
in2 <= "00111111100000000000000000000000"; -- command 0 , not
wait for clock_period;
in1 <= "01111111100000000000000000000000"; -- + inf
in2 <= "00111111100000000000000000000001"; -- command 1, and
wait for clock_period;
in1 <= "01111111000000000000000000000000"; -- + inf
in2 <= "00111111000000000000000000000010"; -- command 2, or
wait for clock_period;
in1 <= "01111111100000000000000000000000"; -- + inf
in2 <= "00111111100000000000000000000011"; -- command 3, nand
wait for clock_period;
in1 <= "01111111100000000000000000000000"; -- + inf
in2 <= "00111111100000000000000000000100"; -- command 4, nor
wait for clock_period;
in1 <= "01111111100000000000000000000000"; -- + inf
in2 <= "00111111100000000000000000000101"; -- command 5, xor
wait for clock_period;
in1 <= "01111111100000000000000000000000"; -- + inf
in2 <= "00111111100000000000000000000110"; -- command 6, xnor
wait for clock_period;
in1 <= "01111111100000000000000000000000"; -- + inf
in2 <= "00111111100000000000000000000111"; -- command 7, xor '1'
wait for clock_period;
cmd <= "1110"; -- reduce and vector test test
in1 <= "01111111100000000000000000000000"; -- + inf
in2 <= "00111111100000000000000000000000"; -- command 0,
wait for clock_period;
in1 <= "11111111111111111111111111111111"; -- all 1
wait for clock_period;
in1 <= "10000000000000000000000000000000"; -- -0
wait for clock_period;
in1 <= "00000000000000000000000000000000"; -- 0
wait for clock_period;
in1 <= "01111111100000000000000000000000"; -- + inf
in2 <= "00111111100000000000000000000001"; -- command 1, and '0'
wait for clock_period;
in2 <= "10111111100000000000000000000001"; -- command 1, and '1'
wait for clock_period;
in2 <= "00111111100000000000000000000010"; -- command 2, or '0'
wait for clock_period;
in2 <= "10111111100000000000000000000010"; -- command 2, or '1'
wait for clock_period;
in2 <= "00111111100000000000000000000011"; -- command 3, nand '0'
wait for clock_period;
in2 <= "10111111100000000000000000000011"; -- command 3, nand '1'
wait for clock_period;
in2 <= "00111111100000000000000000000100"; -- command 4, nor '0'
wait for clock_period;
in2 <= "10111111100000000000000000000100"; -- command 4, nor '1'
wait for clock_period;
in2 <= "00111111100000000000000000000101"; -- command 5, xor '0'
wait for clock_period;
in2 <= "10111111100000000000000000000101"; -- command 5, xor '1'
wait for clock_period;
in2 <= "00111111100000000000000000000110"; -- command 6, xnor '0'
wait for clock_period;
in2 <= "10111111100000000000000000000110"; -- command 6, xnor '1'
wait for clock_period;
in2 <= "00111111100000000000000000000111"; -- command 7, and '0'
wait for clock_period;
in2 <= "10111111100000000000000000000111"; -- command 7, and '1'
wait for clock_period;
cmd <= "1111"; -- add and mult by constant
in2 <= "10111111100000000000000000000000"; -- command 0, + 1
in1 <= to_float (2, in1);
wait for clock_period;
in2 <= "10111111100000000000000000000001"; -- command 1, 1 +
wait for clock_period;
in2 <= "10111111100000000000000000000010"; -- command 2, + 1.0
wait for clock_period;
in2 <= "10111111100000000000000000000011"; -- command 3, 1.0 +
wait for clock_period;
in2 <= "10111111100000000000000000000100"; -- command 4, * 1
wait for clock_period;
in2 <= "10111111100000000000000000000101"; -- command 5, 1 *
wait for clock_period;
in2 <= "10111111100000000000000000000110"; -- command 6, * 1.0
wait for clock_period;
in2 <= "10111111100000000000000000000111"; -- command 7, 1.0 *
wait for clock_period;
wait for clock_period;
cmd <= "0000"; -- add mode
in1 <= (others => '0');
in2 <= (others => '0');
wait for clock_period;
wait for clock_period;
wait for clock_period;
wait for clock_period;
wait for clock_period;
wait for clock_period;
wait for clock_period;
wait for clock_period;
wait;
end process tester;
-- purpose: check the output of the tester
-- type : combinational
-- inputs :
-- outputs:
checktest : process is
variable out16, out16t : fp16; -- 16 bit fp variables
variable out1t, out2t : float32; -- 32 bit float
variable s16, s16t : SIGNED(7 downto 0); -- 7 bit SIGNED
variable latency : INTEGER := 0;
begin -- process checktest
wait for clock_period/2.0;
floop3: for i in 1 to 100 loop
wait for clock_period;
end loop floop3;
latency := 0;
out2t := "01000000100010101100000000000000";
wl1: while out1 /= out2t loop
wait for clock_period;
latency := latency + 1;
assert latency /= 100 report "After 100 loops, pattern never found"
severity failure;
end loop wl1;
report "Latency was " & INTEGER'image(latency) severity note;
floop4: for i in 1 to 100 loop
wait for clock_period;
end loop floop4;
report_error ("42 * 6.5 error",
out1,
to_float (273, out1));
wait for clock_period;
report_error ("6.5 * 42 error",
out1,
to_float (273, out1'high, -out1'low));
wait for clock_period;
report_error ("Multiply 42.25 miscompare",
out1,
"01000010001010010000000000000000"); -- 42.25
wait for clock_period;
report_error ("Multiply 84 miscompare",
out1,
"01000010101010000000000000000000"); -- 84
wait for clock_period;
report_error ("Multiply 2/3 miscompare",
out1,
"00111111001010101010101010101011"); -- 2/3
wait for clock_period;
report_error ("Multiply -273 miscompare",
out1,
"11000011100010001000000000000000"); -- -273
wait for clock_period;
report_error ("mult 2**-148 test miscompare",
out1,
reverse("01000000000000000000000000000001")); -- -2*-148
wait for clock_period;
report_error ("Multiply 2**-129 miscompare",
out1,
reverse("00000000000000000000100000000000")); -- 2**-129
wait for clock_period;
report_error ("6.5 * 42 error",
out1,
to_float (273, out1));
wait for clock_period;
report_error ("Subtract 30303033 - 30303030 miscompare",
out1,
"01000000000000000000000000000000"); -- 2 (not 3, rounding)
wait for clock_period;
report_error ("Subtract 6.5 - 4 miscompare",
out1,
"01000000001000000000000000000000"); -- 2.5
wait for clock_period;
report_error ("Subtract 4 - 6.5 miscompare",
out1,
"11000000001000000000000000000000"); -- -2.5
wait for clock_period;
report_error ("Subtract 4.333 - 1/3 miscompare",
out1,
"01000000100000000000000000000000"); -- 4
wait for clock_period;
report_error ("Add 2.333 miscompare",
out1,
"01000000000101010101010101010101"); -- 2.333333
wait for clock_period;
report_error ("Add 2.333 rev miscompare",
out1,
"01000000000101010101010101010101"); -- 2.333333
wait for clock_period;
report_error ("Add 4 + miscompare",
out1,
"01000000100000000000000000000001"); -- 4
wait for clock_period;
report_error ("div 1/3 test miscompare",
out1,
"00111110101010101010101010101011"); -- 1/3
wait for clock_period;
report_error ("div 369297/2**-126 test miscompare",
out1,
"01111111100000000000000000000000");
wait for clock_period;
report_error ("-1/6 test miscompare",
out1, "10111110001010101010101010101011"); -- -1/6
wait for clock_period;
-- resize function
out16 := to_float (to_slv (out1(-8 downto -23)), 6, 9);
out16t := to_float (1, out16t);
report_error16 ("1.0 fp16 converserion",
out16, out16t);
wait for clock_period;
out16 := to_float (to_slv (out1(-8 downto -23)), 6, 9);
out16t := to_float (arg => -1.0/3.0, size_res => out16t,
round_style => round_zero);
report_error16 ("-1/3 not rounded fp16 converserion",
out16, out16t);
wait for clock_period;
out16 := to_float (to_slv (out1(-8 downto -23)), 6, 9);
out16t := to_float (-1.0/3.0, out16t);
report_error16 ("-1/3 fp16 converserion",
out16, out16t);
-- conversion test
wait for clock_period;
report_error ("1.0 to unsigned miscompare",
out1, "00000000000000000000000000000001");
wait for clock_period;
report_error ("42 to unsigned miscompare",
out1, "00100000000000000000000000101010");
wait for clock_period;
report_error ("-1.0 to signed miscompare",
out1, "01000000000000001111111111111111");
wait for clock_period;
report_error ("1.0 to signed miscompare",
out1, "01100000000000000000000000000001");
wait for clock_period;
report_error ("4.33 to ufixed miscompare",
out1, "10000000000000000000001000101011");
wait for clock_period;
report_error ("1.0 to ufixed miscompare",
out1, "10100000000000000000000010000000");
wait for clock_period;
report_error ("4.333 to sfixed miscompare",
out1, "11000000000000001111110111010101");
wait for clock_period;
report_error ("1.0 to sfixed miscompare",
out1, "11100000000000000000000010000000");
wait for clock_period;
report_error ("unsigned 3 to float miscompare",
out1, to_float(3, out1));
wait for clock_period;
report_error ("unsigned 4 to float miscompare",
out1, to_float(4, out1));
wait for clock_period;
report_error ("signed -2 to float miscompare",
out1, to_float(-2, out1));
wait for clock_period;
report_error ("signed 4 to float miscompare",
out1, to_float(4, out1));
wait for clock_period;
report_error ("ufixed 4.333 to float miscompare",
out1, "01000000100010101100000000000000"); -- 4.333333
wait for clock_period;
report_error ("ufixed 1.0 to float miscompare",
out1, "00111111100000000000000000000000"); -- 1.0
wait for clock_period;
report_error ("sfixed -4.333 to float miscompare",
out1, "11000000100010101100000000000000"); -- -4.333333
wait for clock_period;
report_error ("sfixed 1.0 to float miscompare",
out1, "00111111100000000000000000000000"); -- 1.0
wait for clock_period;
report_error ("denormal mod denormal miscompare",
out1, zero0);
wait for clock_period;
report_error ("large mod large miscompare",
out1, zero0);
wait for clock_period;
report_error ("-4.333 mod 4 miscompare",
out1,
from_string ("01000000011010101010101010101010", out1));
wait for clock_period;
report_error ("denormal rem denormal miscompare",
out1, zero0);
wait for clock_period;
report_error ("large rem large miscompare",
out1, zero0);
wait for clock_period;
out1t := "10111110101010101010101010110000";
report_error ("-4.333 rem 4 miscompare",
out1, out1t);
wait for clock_period;
report_error ("to_float(0) miscompare",
out1, zero0);
wait for clock_period;
report_error ("to_float(0.0) miscompare",
out1, zero0);
wait for clock_period;
report_error ("to_float(8) miscompare",
out1, to_float(8.0, out1));
wait for clock_period;
report_error ("to_float(8.0) miscompare",
out1, to_float(8, out1));
wait for clock_period;
report_error ("to_float(-8) miscompare",
out1, to_float(-8.0, out1));
wait for clock_period;
report_error ("to_float(-8.0) miscompare",
out1, to_float(-8, out1));
wait for clock_period;
report_error ("to_float(27000) miscompare",
out1, to_float(27000.0, out1));
wait for clock_period;
report_error ("to_float(PI) miscompare",
out1, to_float(3.141592653589, out1));
-- Conversion test
wait for clock_period;
report_error ("-1 miscompare",
out1, to_float(-1, out1));
wait for clock_period;
report_error ("-(-2) miscompare",
out1, to_float(2, out1));
wait for clock_period;
report_error ("abs(-2) miscompare",
out1, to_float(2, out1));
wait for clock_period;
report_error ("abs(1) miscompare",
out1, to_float(1, out1));
wait for clock_period;
report_error ("scalb (1, 1) miscompare",
out1, to_float(2, out1));
wait for clock_period;
report_error ("scalb (1, -1) miscompare",
out1, to_float(0.5, out1));
wait for clock_period;
s16 := SIGNED (to_slv (out1(-16 downto -23)));
assert (s16 = 0) report "logb (1) returned "
& to_string(to_sfixed(s16)) severity error;
wait for clock_period;
s16 := SIGNED (to_slv (out1(-16 downto -23)));
assert (s16 = -2) report "logb (0.25) returned "
& to_string(to_sfixed(s16)) severity error;
wait for clock_period;
out1t := "00111111100000000000000000000001";
report_error ("nextafter (1, 1.5)", out1, out1t);
wait for clock_period;
out1t := "01000000011111111111111111111111";
report_error ("nextafter (4, 1.5)", out1, out1t);
wait for clock_period;
out1t := "00111111011111111111111111111111";
report_error ("nextafter (1, -1.5)", out1, out1t);
wait for clock_period;
out1t := "11000000011111111111111111111111";
report_error ("nextafter (-4, -1.5)", out1, out1t);
wait for clock_period;
out1t := "00111111100000000000000000000001";
report_error ("nextafter (1, inf)", out1, out1t);
wait for clock_period;
out1t := "01000000100000000000000000000001";
report_error ("nextafter (4, inf)", out1, out1t);
wait for clock_period;
out1t := "00111111011111111111111111111111";
report_error ("nextafter (1, neginf)", out1, out1t);
wait for clock_period;
out1t := "11000000100000000000000000000001";
report_error ("nextafter (-4, neginf)", out1, out1t);
wait for clock_period;
report_error ("Copysign (2,2)", out1, to_float(2, out1));
wait for clock_period;
report_error ("Copysign (-3,3)", out1, to_float(3, out1));
wait for clock_period;
report_error ("Copysign (4,-4)", out1, to_float(-4, out1));
wait for clock_period;
report_error ("Copysign (-5,-5)", out1, to_float(-5, out1));
wait for clock_period;
out1t := "10001110000000000000000000000000";
report_error ("compare test 15, 15", out1, out1t);
wait for clock_period;
out1t := "01101001000000000000000000000000";
report_error ("compare test 15.5, -2", out1, out1t);
wait for clock_period;
out1t := "01010100000000000000000000000000";
report_error ("compare test -2, 2", out1, out1t);
wait for clock_period;
out1t := "01101000010000000000000000000000";
report_error ("compare test inf, -2", out1, out1t);
wait for clock_period;
out1t := "01000000101000000000000000000000";
report_error ("compare test NAN, -2", out1, out1t);
wait for clock_period;
out1t := "10000000011111111111111111111111"; -- not + inf
report_error ("not +inf", out1, out1t);
wait for clock_period;
out1t := "00111111100000000000000000000000"; -- and
report_error ("and +inf", out1, out1t);
wait for clock_period;
out1t := "01111111000000000000000000000010"; -- or
report_error ("or +inf", out1, out1t);
wait for clock_period;
out1t := "11000000011111111111111111111111"; -- nand
report_error ("nand +inf", out1, out1t);
wait for clock_period;
out1t := "10000000011111111111111111111011"; -- nor
report_error ("nor +inf", out1, out1t);
wait for clock_period;
out1t := "01000000000000000000000000000101"; -- xor
report_error ("xor +inf", out1, out1t);
wait for clock_period;
out1t := "10111111111111111111111111111001"; -- xnor
report_error ("xnor +inf", out1, out1t);
wait for clock_period;
out1t := "10000000011111111111111111111111"; -- xnor '1'
report_error ("+inf xor '1'", out1, out1t);
wait for clock_period;
out1t := "01100100000000000000000000000000"; -- reduce test
report_error ("_reduce test", out1, out1t);
wait for clock_period;
out1t := "10100100000000000000000000000000"; -- reduce test
report_error ("_reduce all 1 test", out1, out1t);
wait for clock_period;
out1t := "01101000000000000000000000000000"; -- reduce test
report_error ("_reduce -0 test", out1, out1t);
wait for clock_period;
out1t := "01010100000000000000000000000000"; -- reduce test
report_error ("_reduce 0 test", out1, out1t);
wait for clock_period;
out1t := "00000000000000000000000000000000"; -- 0
report_error ("and 0 test", out1, out1t);
wait for clock_period;
out1t := "01111111100000000000000000000000"; -- + inf
report_error ("and 1 test", out1, out1t);
wait for clock_period;
out1t := "01111111100000000000000000000000"; -- + inf
report_error ("or 0 test", out1, out1t);
wait for clock_period;
out1t := "11111111111111111111111111111111"; -- all 1
assert (to_slv (out1) = to_slv (out1t))
report "or 1 test error " & to_string (out1) & " /= "
& to_string (out1t) severity error;
wait for clock_period;
out1t := "11111111111111111111111111111111"; -- all 1
assert (to_slv (out1) = to_slv (out1t))
report "nand 0 test error " & to_string (out1) & " /= "
& to_string (out1t) severity error;
wait for clock_period;
out1t := "10000000011111111111111111111111"; -- - denormal
report_error ("nand 1 test", out1, out1t);
wait for clock_period;
out1t := "10000000011111111111111111111111"; -- - denormal
report_error ("nor 0 test", out1, out1t);
wait for clock_period;
out1t := "00000000000000000000000000000000"; -- 0
report_error ("nor 1 test", out1, out1t);
wait for clock_period;
out1t := "01111111100000000000000000000000"; -- + inf
report_error ("xor 0 test", out1, out1t);
wait for clock_period;
out1t := "10000000011111111111111111111111"; -- - denormal
report_error ("xor 1 test", out1, out1t);
wait for clock_period;
out1t := "10000000011111111111111111111111"; -- - denormal
report_error ("xnor 0 test", out1, out1t);
wait for clock_period;
out1t := "01111111100000000000000000000000"; -- + inf
report_error ("xnor 1 test", out1, out1t);
wait for clock_period;
out1t := "00000000000000000000000000000000"; -- 0
report_error ("and 0 test", out1, out1t);
wait for clock_period;
out1t := "01111111100000000000000000000000"; -- + inf
report_error ("and 1 test", out1, out1t);
wait for clock_period;
out1t := to_float(3, out1t);
report_error ("2 + 1 test", out1, out1t);
wait for clock_period;
report_error ("1 + 2 test", out1, out1t);
wait for clock_period;
report_error ("2 + 1.0 test", out1, out1t);
wait for clock_period;
report_error ("1.0 + 2 test", out1, out1t);
wait for clock_period;
out1t := to_float(2, out1t);
report_error ("2 * 1 test", out1, out1t);
wait for clock_period;
report_error ("1 * 2 test", out1, out1t);
wait for clock_period;
report_error ("2 * 1.0 test", out1, out1t);
wait for clock_period;
report_error ("1.0 * 2 test", out1, out1t);
wait for clock_period;
assert (false) report "Testing complete" severity note;
stop_clock <= true;
wait;
end process checktest;
end architecture testbench;
+26
View File
@@ -0,0 +1,26 @@
# -------------------------------------------------
# Compile script for GHDL
# -------------------------------------------------
include ../make/defs.mk
# -------------------------------------------------
# Global options
# -------------------------------------------------
LANG_STD := 93c
IEEE_STD := standard
WORK_LIB := unisim
TARGET := unisim
# -------------------------------------------------
# Target options
# -------------------------------------------------
SRCS := $(LIB_PATH)/unisims/unisim_VPKG.vhd
SRCS += $(LIB_PATH)/unisims/unisim_VCOMP.vhd
SRCS += $(LIB_PATH)/unisims/unisim_SMODEL.vhd
SRCS += $(LIB_PATH)/unisims/unisim_VITAL.vhd
GHDL_OPTS := -fsynopsys -fexplicit
include ../make/ghdl.mk
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
+23
View File
@@ -0,0 +1,23 @@
FOLDER ?= lib
TARGETS = $(shell find $(FOLDER)/ -name "*.make")
INSTR := $(foreach number,$(TARGETS),make -C $(shell dirname $(number)) -f $(shell basename $(number)) $(MAKECMDGOALS) &&) true
all:
$(INSTR)
elaborate:
$(INSTR)
run:
$(INSTR)
run_wave:
$(INSTR)
clean:
$(INSTR)
mrproper:
$(INSTR)
+17
View File
@@ -0,0 +1,17 @@
include $(VHDL_HOME)/make/defs.mk
TOOL_PATH := $(VHDL_HOME)/tools/jcpu
.PHONY: install uninstall
all: install
$(TOOL_PATH):
mkdir -p $@
install: $(TOOL_PATH)
cp -r tools/* $(TOOL_PATH)
chmod +x $(TOOL_PATH)/*.rb
uninstall:
rm -rf $(TOOL_PATH)
+74
View File
@@ -0,0 +1,74 @@
; -------------------------------------------------
; Constants
; -------------------------------------------------
; External RAM/ROM
xmem
crlf: dc 13, 10, 0
msg_txt1: dc "J-CPU V1.", 0
msg_txt2: dc "Ready.", 13, 10, 0
msg_txt3: dc "Mimi ist eine liebe Katze !!!", 13, 10, 0
; -------------------------------------------------
; Program
; -------------------------------------------------
code
reset: jmp init
org 0x001
; nop
reti
; -------------------------------------------------
; Main
; -------------------------------------------------
init: xin R0, (cpu_status)
call bin2hex
call uart_putchar
mov R0, R1
call uart_putchar
mov R1, crlf
call uart_puts
loop:
; Print line 0
mov R1, msg_txt1
call uart_puts
cin R0, (cpu_revision)
add R0, 0x30
call uart_putchar
mov R1, crlf
call uart_puts
; Print line 1
mov R1, msg_txt2
call uart_puts
; Print line 3
mov R1, msg_txt3
call uart_puts
mov R15, 160
fill_lp: tst R15
jz ex_fill
dec R15
mov R1, 48
ct_loop: cmp R1, 58
jeq ex_ct
mov R0, R1
inc R1
call uart_putchar
jmp ct_loop
ex_ct: jmp fill_lp
ex_fill: mov R1, crlf
call uart_puts
jmp loop
; -------------------------------------------------
include "./xregs.inc.jsm"
include "../../../../tools/jcpu/lib/cregs.inc.jsm"
include "../../../../tools/jcpu/lib/utils.inc.jsm"
include "../../../../tools/jcpu/lib/uart.inc.jsm"
include "../../../../tools/jcpu/lib/delays.inc.jsm"
+502
View File
@@ -0,0 +1,502 @@
# ----------------------------------------------------------------------
# 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 hallo_welt_uart.jsm
# ---------------------------------------------------------------
# Shift the USER1 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: XIN R00, (0x02)
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "00228020"
# 0x003: CALL 0x029
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "0033B029"
# 0x004: CALL 0x039
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "0043B039"
# 0x005: MOV R00, R01
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "00502010"
# 0x006: CALL 0x039
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "0063B039"
# 0x007: MOV R01, 0x00
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "00703001"
# 0x008: CALL 0x030
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "0083B030"
# 0x009: MOV R01, 0x03
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "00903031"
# 0x00A: CALL 0x030
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "00A3B030"
# 0x00B: CIN R00, (0x00)
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "00B29000"
# 0x00C: ADD R00, 0x30
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "00C11300"
# 0x00D: CALL 0x039
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "00D3B039"
# 0x00E: MOV R01, 0x00
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "00E03001"
# 0x00F: CALL 0x030
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "00F3B030"
# 0x010: MOV R01, 0x0D
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "010030D1"
# 0x011: CALL 0x030
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "0113B030"
# 0x012: MOV R01, 0x16
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "01203161"
# 0x013: CALL 0x030
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "0133B030"
# 0x014: MOV R15, 0xA0
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "01403A0F"
# 0x015: TST R15
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "0150F00F"
# 0x016: JZ 0x020
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "01631020"
# 0x017: DEC R15
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "0171501F"
# 0x018: MOV R01, 0x30
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "01803301"
# 0x019: CMP R01, 0x3A
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "0190F3A1"
# 0x01A: JEQ 0x01F
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "01A3901F"
# 0x01B: MOV R00, R01
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "01B02010"
# 0x01C: INC R01
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "01C11011"
# 0x01D: CALL 0x039
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "01D3B039"
# 0x01E: JMP 0x019
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "01E30019"
# 0x01F: JMP 0x015
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "01F30015"
# 0x020: MOV R01, 0x00
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "02003001"
# 0x021: CALL 0x030
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "0213B030"
# 0x022: JMP 0x009
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "02230009"
# 0x023: AND R00, 0x0F
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "023190F0"
# 0x024: CMP R00, 0x0A
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "0240F0A0"
# 0x025: JLT 0x027
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "02535027"
# 0x026: ADD R00, 0x07
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "02611070"
# 0x027: ADD R00, 0x30
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "02711300"
# 0x028: RET
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "0283E000"
# 0x029: PUSH R00
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "0293C000"
# 0x02A: CALL 0x023
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "02A3B023"
# 0x02B: MOV R01, R00
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "02B02001"
# 0x02C: POP R00
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "02C3D000"
# 0x02D: SWAP R00
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "02D2A000"
# 0x02E: CALL 0x023
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "02E3B023"
# 0x02F: RET
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "02F3E000"
# 0x030: PUSH R00
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "0303C000"
# 0x031: MOVX R00, (R01)
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "03104010"
# 0x032: INC R01
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "03211011"
# 0x033: TST R00
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "0330F000"
# 0x034: JZ 0x037
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "03431037"
# 0x035: CALL 0x039
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "0353B039"
# 0x036: JMP 0x031
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "03630031"
# 0x037: POP R00
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "0373D000"
# 0x038: RET
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "0383E000"
# 0x039: JMP 0x03A
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "0393003A"
# 0x03A: PUSH R01
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "03A3C001"
# 0x03B: XIN R01, (0x06)
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "03B28061"
# 0x03C: AND R01, 0x02
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "03C19021"
# 0x03D: JNZ 0x03B
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "03D3203B"
# 0x03E: XOUT (0x02), R00
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "03E24020"
# 0x03F: POP R01
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "03F3D001"
# 0x040: RET
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "0403E000"
# 0x041: PUSH R01
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "0413C001"
# 0x042: XIN R01, (0x06)
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "04228061"
# 0x043: AND R01, 0x10
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "04319101"
# 0x044: JNZ 0x042
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "04432042"
# 0x045: XIN R00, (0x02)
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "04528020"
# 0x046: POP R01
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "0463D001"
# 0x047: RET
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "0473E000"
# 0x048: PUSH R15
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "0483C00F"
# 0x049: MOV R15, 0x0A
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "049030AF"
# 0x04A: CALL 0x04F
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "04A3B04F"
# 0x04B: DEC R15
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "04B1501F"
# 0x04C: JNZ 0x04A
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "04C3204A"
# 0x04D: POP R15
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "04D3D00F"
# 0x04E: RET
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "04E3E000"
# 0x04F: PUSH R15
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "04F3C00F"
# 0x050: MOV R15, 0x0A
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "050030AF"
# 0x051: CALL 0x056
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "0513B056"
# 0x052: DEC R15
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "0521501F"
# 0x053: JNZ 0x051
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "05332051"
# 0x054: POP R15
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "0543D00F"
# 0x055: RET
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "0553E000"
# 0x056: PUSH R15
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "0563C00F"
# 0x057: MOV R15, 0x0A
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "057030AF"
# 0x058: CALL 0x05D
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "0583B05D"
# 0x059: DEC R15
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "0591501F"
# 0x05A: JNZ 0x058
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "05A32058"
# 0x05B: POP R15
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "05B3D00F"
# 0x05C: RET
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "05C3E000"
# 0x05D: PUSH R15
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "05D3C00F"
# 0x05E: MOV R15, 0x0A
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "05E030AF"
# 0x05F: CALL 0x064
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "05F3B064"
# 0x060: DEC R15
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "0601501F"
# 0x061: JNZ 0x05F
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "0613205F"
# 0x062: POP R15
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "0623D00F"
# 0x063: RET
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "0633E000"
# 0x064: PUSH R15
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "0643C00F"
# 0x065: MOV R15, 0x0A
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "065030AF"
# 0x066: CALL 0x06B
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "0663B06B"
# 0x067: DEC R15
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "0671501F"
# 0x068: JNZ 0x066
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "06832066"
# 0x069: POP R15
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "0693D00F"
# 0x06A: RET
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "06A3E000"
# 0x06B: PUSH R15
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "06B3C00F"
# 0x06C: MOV R15, 0x63
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "06C0363F"
# 0x06D: NOP
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "06D00000"
# 0x06E: NOP
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "06E00000"
# 0x06F: NOP
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "06F00000"
# 0x070: DEC R15
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "0701501F"
# 0x071: JNZ 0x06D
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "0713206D"
# 0x072: POP R15
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "0723D00F"
# 0x073: RET
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "0733E000"
# 0x074: PUSH R15
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "0743C00F"
# 0x075: MOV R15, 0x09
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "0750309F"
# 0x076: NOP
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "07600000"
# 0x077: NOP
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "07700000"
# 0x078: NOP
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "07800000"
# 0x079: DEC R15
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "0791501F"
# 0x07A: JNZ 0x076
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "07A32076"
# 0x07B: POP R15
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "07B3D00F"
# 0x07C: RET
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "07C3E000"
# Assembled from hallo_welt_uart.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 "000D"
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "010A"
::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 "034A"
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "042D"
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "0543"
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "0650"
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "0755"
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "0820"
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "0956"
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "0A31"
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "0B2E"
::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 "0D52"
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "0E65"
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "0F61"
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "1064"
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "1179"
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "122E"
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "130D"
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "140A"
::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 "164D"
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "1769"
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "186D"
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "1969"
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "1A20"
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "1B69"
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "1C73"
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "1D74"
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "1E20"
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "1F65"
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "2069"
::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 "2265"
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "2320"
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "246C"
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "2569"
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "2665"
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "2762"
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "2865"
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "2920"
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "2A4B"
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "2B61"
::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 "2D7A"
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "2E65"
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "2F20"
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "3021"
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "3121"
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "3221"
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "330D"
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "340A"
::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "3500"
::chipscope::csejtag_target unlock $handle
::chipscope::csejtag_target close $handle
::chipscope::csejtag_session destroy $handle
exit
+1 -1
View File
@@ -26,7 +26,7 @@
TARGET=$2
DSTDIR=$1
JASM_HOME=/cygdrive/w/vhdl/lib/CPUs/JCpu/tools
JASM_HOME=$VHDL_HOME/tools/jcpu
$JASM_HOME/jasm.rb $TARGET.jsm
+64
View File
@@ -0,0 +1,64 @@
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
+41
View File
@@ -0,0 +1,41 @@
; External registers
btn_port: equ 0x00 ; RO
led_port: equ 0x01 ; R/W
uart_data: equ 0x02 ; R/W
lcd_port: equ 0x03 ; R/W
ctrl_reg: equ 0x04 ; R/W
CTRL_VGA_ENABLE: equ 0x04
CTRL_TIMER_ENABLE: equ 0x02
dip_port: equ 0x05 ; RO
uart_status: equ 0x06 ; RO
sdram_reg: equ 0x07 ; R/W
FIFO_CTRL_IS_CMD: equ 0x04
FIFO_CTRL_IS_WRITE: equ 0x10
FIFO_CTRL_IS_READ: equ 0x20
FIFO_STAT_CMD_FULL: equ 0x01
FIFO_STAT_CMD_EMPTY: equ 0x02
FIFO_STAT_WRITE_DATA_FULL: equ 0x04
FIFO_STAT_WRITE_DATA_EMPTY: equ 0x08
FIFO_STAT_READ_DATA_FULL: equ 0x10
FIFO_STAT_READ_DATA_EMPTY: equ 0x20
sdram_addr: equ 0x08 ; R/W
sdram_addr0: equ 0x08 ; R/W
sdram_addr1: equ 0x09 ; R/W
sdram_addr2: equ 0x0A ; R/W
reg_cg_char_addr: equ 0x0B ; RW
reg_cg_line_addr: equ 0x0C ; RW
reg_cg_data: equ 0x0D ; RW
reg_cg_ctrl: equ 0x0E ; WO
reg_hwstat: equ 0x0E ; RO
reg_color_red: equ 0x10 ; RW
reg_color_grn: equ 0x11 ; RW
reg_color_blu: equ 0x12 ; RW
uart_baudrate: equ 0x13 ; R/W
vga_read_addr: equ 0x14 ; R/W
vga_read_addr0: equ 0x14 ; R/W
vga_read_addr1: equ 0x15 ; R/W
vga_read_addr2: equ 0x16 ; R/W
timer_reload: equ 0x17 ; R/W
timer_reload0: equ 0x17 ; R/W
timer_reload1: equ 0x18 ; R/W
timer_reload2: equ 0x19 ; R/W
+24
View File
@@ -0,0 +1,24 @@
[*]
[*] GTKWave Analyzer v3.3.104 (w)1999-2020 BSI
[*] Sun Mar 21 20:24:10 2021
[*]
[dumpfile] "/home/jens/work/vhdl/trunk/lib/CPUs/JCpu/ghdl/build/cpu_embedded/cpu_embedded.ghw"
[dumpfile_mtime] "Sun Mar 21 20:24:02 2021"
[dumpfile_size] 23928
[savefile] "/home/jens/work/vhdl/trunk/lib/CPUs/JCpu/ghdl/build/cpu_embedded/cpu_embedded.gtkw"
[timestart] 0
[size] 1000 600
[pos] -1 -1
*-28.221537 367000000 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1
[treeopen] top.
[treeopen] top.tb_cpu_embedded.
[sst_width] 233
[signals_width] 78
[sst_expanded] 1
[sst_vpaned_height] 144
@28
top.tb_cpu_embedded.uut.clk
@29
top.tb_cpu_embedded.uut.rst
[pattern_trace] 1
[pattern_trace] 0
+16
View File
@@ -0,0 +1,16 @@
# -----------------------------------------------------------
include $(VHDL_HOME)/make/defs.mk
# -----------------------------------------------------------
include jcpu_core.inc
SRCS += $(JCPU_CORE_SRCS)
SRCS += ../src/itest_irom.vhdl
SRCS += ../src/cpu_embedded.vhd
SRCS += ../src/tb_cpu_embedded.vhd
# Compile
TARGET := cpu_embedded
ENTITY := tb_cpu_embedded
include $(VHDL_HOME)/make/ghdl.mk
@@ -0,0 +1,20 @@
# -----------------------------------------------------------
include $(VHDL_HOME)/make/defs.mk
# -----------------------------------------------------------
include $(VHDL_HOME)/lib/uart/ghdl/uart_sim.inc
include jcpu_core.inc
SRCS += $(UART_SIM_SRCS)
SRCS += $(JCPU_CORE_SRCS)
SRCS += ../src/hallo_welt_uart_irom.vhdl
SRCS += ../src/hallo_welt_uart_xrom.vhdl
SRCS += ../src/cpu_embedded_with_uart.vhd
SRCS += ../src/tb_cpu_embedded_with_uart.vhd
# Compile
TARGET := tb_cpu_embedded_with_uart
ENTITY := tb_cpu_embedded_with_uart
RUN_TIME := 100us
include $(VHDL_HOME)/make/ghdl.mk
+26
View File
@@ -0,0 +1,26 @@
[*]
[*] GTKWave Analyzer v3.3.104 (w)1999-2020 BSI
[*] Sun Mar 21 20:23:20 2021
[*]
[dumpfile] "/home/jens/work/vhdl/trunk/lib/CPUs/JCpu/ghdl/build/cpu_itest/cpu_itest.ghw"
[dumpfile_mtime] "Sun Mar 21 20:23:14 2021"
[dumpfile_size] 23880
[savefile] "/home/jens/work/vhdl/trunk/lib/CPUs/JCpu/ghdl/build/cpu_itest/cpu_itest.gtkw"
[timestart] 0
[size] 1000 600
[pos] -1 -1
*-28.353857 33340 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1
[treeopen] top.
[treeopen] top.tb_cpu.
[treeopen] top.tb_cpu.uut.
[treeopen] top.tb_cpu.uut.inst_pc.
[sst_width] 233
[signals_width] 134
[sst_expanded] 1
[sst_vpaned_height] 144
@22
#{top.tb_cpu.xmem_din[7:0]} top.tb_cpu.xmem_din[7] top.tb_cpu.xmem_din[6] top.tb_cpu.xmem_din[5] top.tb_cpu.xmem_din[4] top.tb_cpu.xmem_din[3] top.tb_cpu.xmem_din[2] top.tb_cpu.xmem_din[1] top.tb_cpu.xmem_din[0]
@23
#{top.tb_cpu.uut.inst_pc.pc_next[11:0]} top.tb_cpu.uut.inst_pc.pc_next[11] top.tb_cpu.uut.inst_pc.pc_next[10] top.tb_cpu.uut.inst_pc.pc_next[9] top.tb_cpu.uut.inst_pc.pc_next[8] top.tb_cpu.uut.inst_pc.pc_next[7] top.tb_cpu.uut.inst_pc.pc_next[6] top.tb_cpu.uut.inst_pc.pc_next[5] top.tb_cpu.uut.inst_pc.pc_next[4] top.tb_cpu.uut.inst_pc.pc_next[3] top.tb_cpu.uut.inst_pc.pc_next[2] top.tb_cpu.uut.inst_pc.pc_next[1] top.tb_cpu.uut.inst_pc.pc_next[0]
[pattern_trace] 1
[pattern_trace] 0
+17
View File
@@ -0,0 +1,17 @@
# -----------------------------------------------------------
include $(VHDL_HOME)/make/defs.mk
# -----------------------------------------------------------
include jcpu_core.inc
SRCS += $(JCPU_CORE_SRCS)
SRCS += $(LIB_PATH)/PCK_FIO-2002.7/PCK_FIO_1993.vhd
SRCS += $(LIB_PATH)/PCK_FIO-2002.7/PCK_FIO_1993_BODY.vhd
SRCS += ../src/itest_irom.vhdl
SRCS += ../src/tb_cpu_itest.vhd
# Compile
TARGET := cpu_itest
ENTITY := tb_cpu
include $(VHDL_HOME)/make/ghdl.mk
+20
View File
@@ -0,0 +1,20 @@
# -----------------------------------------------------------
include $(VHDL_HOME)/make/defs.mk
# -----------------------------------------------------------
PKG_NAME := JCPU_CORE
# -----------------------------------------------------------
MOD_PATH := $(LIB_PATH)/CPUs/JCpu/src/core
$(PKG_NAME)_SRCS += $(MOD_PATH)/cpu_pkg.vhd
$(PKG_NAME)_SRCS += $(MOD_PATH)/cpu.vhd
$(PKG_NAME)_SRCS += $(MOD_PATH)/alu.vhd
$(PKG_NAME)_SRCS += $(MOD_PATH)/chipram.vhd
$(PKG_NAME)_SRCS += $(MOD_PATH)/chipreg.vhd
$(PKG_NAME)_SRCS += $(MOD_PATH)/dpath_ctrl.vhd
$(PKG_NAME)_SRCS += $(MOD_PATH)/int_ctrl.vhd
$(PKG_NAME)_SRCS += $(MOD_PATH)/pc.vhd
$(PKG_NAME)_SRCS += $(MOD_PATH)/reg_dual.vhd
$(PKG_NAME)_SRCS += $(MOD_PATH)/stack_ctrl.vhd
# -----------------------------------------------------------
+32
View File
@@ -0,0 +1,32 @@
[*]
[*] GTKWave Analyzer v3.3.104 (w)1999-2020 BSI
[*] Mon Mar 22 20:01:47 2021
[*]
[dumpfile] "/home/jens/work/vhdl/trunk/lib/CPUs/JCpu/ghdl/build/mul8x8/mul8x8.ghw"
[dumpfile_mtime] "Mon Mar 22 20:00:48 2021"
[dumpfile_size] 25852
[savefile] "/home/jens/work/vhdl/trunk/lib/CPUs/JCpu/ghdl/build/mul8x8/mul8x8.gtkw"
[timestart] 0
[size] 1173 600
[pos] -1 -1
*-28.009827 724000000 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1
[treeopen] top.
[treeopen] top.tb_cpu_embedded.
[treeopen] top.tb_cpu_embedded.uut.
[sst_width] 233
[signals_width] 150
[sst_expanded] 1
[sst_vpaned_height] 144
@28
top.tb_cpu_embedded.rst
top.tb_cpu_embedded.clk
@22
#{top.tb_cpu_embedded.uut.irom_addr[11:0]} top.tb_cpu_embedded.uut.irom_addr[11] top.tb_cpu_embedded.uut.irom_addr[10] top.tb_cpu_embedded.uut.irom_addr[9] top.tb_cpu_embedded.uut.irom_addr[8] top.tb_cpu_embedded.uut.irom_addr[7] top.tb_cpu_embedded.uut.irom_addr[6] top.tb_cpu_embedded.uut.irom_addr[5] top.tb_cpu_embedded.uut.irom_addr[4] top.tb_cpu_embedded.uut.irom_addr[3] top.tb_cpu_embedded.uut.irom_addr[2] top.tb_cpu_embedded.uut.irom_addr[1] top.tb_cpu_embedded.uut.irom_addr[0]
@23
#{top.tb_cpu_embedded.uut.irom_data[17:0]} top.tb_cpu_embedded.uut.irom_data[17] top.tb_cpu_embedded.uut.irom_data[16] top.tb_cpu_embedded.uut.irom_data[15] top.tb_cpu_embedded.uut.irom_data[14] top.tb_cpu_embedded.uut.irom_data[13] top.tb_cpu_embedded.uut.irom_data[12] top.tb_cpu_embedded.uut.irom_data[11] top.tb_cpu_embedded.uut.irom_data[10] top.tb_cpu_embedded.uut.irom_data[9] top.tb_cpu_embedded.uut.irom_data[8] top.tb_cpu_embedded.uut.irom_data[7] top.tb_cpu_embedded.uut.irom_data[6] top.tb_cpu_embedded.uut.irom_data[5] top.tb_cpu_embedded.uut.irom_data[4] top.tb_cpu_embedded.uut.irom_data[3] top.tb_cpu_embedded.uut.irom_data[2] top.tb_cpu_embedded.uut.irom_data[1] top.tb_cpu_embedded.uut.irom_data[0]
@22
#{top.tb_cpu_embedded.xmem_addr[7:0]} top.tb_cpu_embedded.xmem_addr[7] top.tb_cpu_embedded.xmem_addr[6] top.tb_cpu_embedded.xmem_addr[5] top.tb_cpu_embedded.xmem_addr[4] top.tb_cpu_embedded.xmem_addr[3] top.tb_cpu_embedded.xmem_addr[2] top.tb_cpu_embedded.xmem_addr[1] top.tb_cpu_embedded.xmem_addr[0]
#{top.tb_cpu_embedded.xmem_dout[7:0]} top.tb_cpu_embedded.xmem_dout[7] top.tb_cpu_embedded.xmem_dout[6] top.tb_cpu_embedded.xmem_dout[5] top.tb_cpu_embedded.xmem_dout[4] top.tb_cpu_embedded.xmem_dout[3] top.tb_cpu_embedded.xmem_dout[2] top.tb_cpu_embedded.xmem_dout[1] top.tb_cpu_embedded.xmem_dout[0]
#{top.tb_cpu_embedded.xmem_din[7:0]} top.tb_cpu_embedded.xmem_din[7] top.tb_cpu_embedded.xmem_din[6] top.tb_cpu_embedded.xmem_din[5] top.tb_cpu_embedded.xmem_din[4] top.tb_cpu_embedded.xmem_din[3] top.tb_cpu_embedded.xmem_din[2] top.tb_cpu_embedded.xmem_din[1] top.tb_cpu_embedded.xmem_din[0]
[pattern_trace] 1
[pattern_trace] 0
+16
View File
@@ -0,0 +1,16 @@
# -----------------------------------------------------------
include $(VHDL_HOME)/make/defs.mk
# -----------------------------------------------------------
include jcpu_core.inc
SRCS += $(JCPU_CORE_SRCS)
SRCS += ../src/mul8x8_irom.vhdl
SRCS += ../src/cpu_embedded.vhd
SRCS += ../src/tb_cpu_embedded.vhd
# Compile
TARGET := mul8x8
ENTITY := tb_cpu_embedded
include $(VHDL_HOME)/make/ghdl.mk
+24
View File
@@ -0,0 +1,24 @@
[*]
[*] GTKWave Analyzer v3.3.104 (w)1999-2020 BSI
[*] Sun Mar 21 20:25:04 2021
[*]
[dumpfile] "/home/jens/work/vhdl/trunk/lib/CPUs/JCpu/ghdl/build/reti_issue/reti_issue.ghw"
[dumpfile_mtime] "Sun Mar 21 20:25:01 2021"
[dumpfile_size] 22085
[savefile] "/home/jens/work/vhdl/trunk/lib/CPUs/JCpu/ghdl/build/reti_issue/reti_issue.gtkw"
[timestart] 0
[size] 1000 600
[pos] -1 -1
*-28.221537 563000000 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1
[treeopen] top.
[treeopen] top.tb_cpu.
[sst_width] 233
[signals_width] 78
[sst_expanded] 1
[sst_vpaned_height] 144
@28
top.tb_cpu.uut.clk
@29
top.tb_cpu.uut.rst
[pattern_trace] 1
[pattern_trace] 0
+17
View File
@@ -0,0 +1,17 @@
# -----------------------------------------------------------
include $(VHDL_HOME)/make/defs.mk
# -----------------------------------------------------------
include jcpu_core.inc
SRCS += $(JCPU_CORE_SRCS)
SRCS += $(LIB_PATH)/PCK_FIO-2002.7/PCK_FIO_1993.vhd
SRCS += $(LIB_PATH)/PCK_FIO-2002.7/PCK_FIO_1993_BODY.vhd
SRCS += ../src/reti_issue_irom.vhdl
SRCS += ../src/tb_cpu_itest.vhd
# Compile
TARGET := reti_issue
ENTITY := tb_cpu
include $(VHDL_HOME)/make/ghdl.mk
@@ -0,0 +1,33 @@
[*]
[*] GTKWave Analyzer v3.3.104 (w)1999-2020 BSI
[*] Sun Apr 4 08:30:47 2021
[*]
[dumpfile] "/home/jens/work/vhdl/trunk/lib/CPUs/JCpu/ghdl/build/tb_cpu_embedded_with_uart/tb_cpu_embedded_with_uart.fst"
[dumpfile_mtime] "Sun Apr 4 08:29:53 2021"
[dumpfile_size] 5098
[savefile] "/home/jens/work/vhdl/trunk/lib/CPUs/JCpu/ghdl/build/tb_cpu_embedded_with_uart/tb_cpu_embedded_with_uart.gtkw"
[timestart] 0
[size] 1856 1136
[pos] 1983 26
*-27.352621 339300000 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1
[sst_width] 383
[signals_width] 256
[sst_expanded] 1
[sst_vpaned_height] 331
@28
uut.clk
uut.ce
uut.rst
@22
uut.irom_data[17:0]
@28
uut.cpu_xmem_re
uut.cpu_xmem_we
@22
uut.cpu_xmem_dout[7:0]
uut.cpu_xmem_din[7:0]
uut.cpu_xmem_addr[7:0]
@29
uut.cpu_io_sel
[pattern_trace] 1
[pattern_trace] 0
Binary file not shown.
+105 -107
View File
@@ -1,107 +1,105 @@
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}
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_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 {49892711 ps} {50005647 ps}
+2 -2
View File
@@ -6,8 +6,8 @@ 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
add wave -noupdate -format Literal -radix hexadecimal /tb_cpu_embedded/uut/xmem_addr
add wave -noupdate -format Literal -radix hexadecimal /tb_cpu_embedded/uut/xmem_din
TreeUpdate [SetDefaultTree]
WaveRestoreCursors {{Cursor 1} {2168142 ps} 0}
configure wave -namecolwidth 143
+4 -4
View File
@@ -54,14 +54,14 @@ architecture Behavioral of alu is
--------------------------------------------------------------------------
function test_zero(arg : unsigned) return STD_LOGIC is
variable result : STD_LOGIC;
variable res : STD_LOGIC;
begin
result := '0';
res := '0';
for i in arg'range loop
result := result or To_X01(arg(i));
res := res or To_X01(arg(i));
end loop;
return not result;
return not res;
end test_zero;
--------------------------------------------------------------------------
+1 -1
View File
@@ -218,7 +218,7 @@ begin
xmem_dout <= mem_data;
xmem_addr <= mem_addr;
cmem_din <= creg_ctrl_out.cmem_high & mem_data;
cmem_addr <= '1' & creg_ctrl_out.bank_sel & mem_addr(MIN(cmem_addr'length-creg_ctrl_out.bank_sel'length-1, mem_addr'length)-1 downto 0);
cmem_addr <= '1' & creg_ctrl_out.bank_sel & mem_addr(JMIN(cmem_addr'length-creg_ctrl_out.bank_sel'length-1, mem_addr'length)-1 downto 0);
--------------------------------------------------------------------
mem_ctrl_lines:
+18 -18
View File
@@ -217,16 +217,16 @@ package cpu_pkg is
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 Instr(opcode : opcode_t; reg_ptr_a : integer) return inst_t;
function Instr(opcode : opcode_t; reg_ptr_a, reg_ptr_b : integer) return inst_t;
function Instr(opcode : opcode_t; reg_ptr_a, reg_ptr_b, reg_ptr_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;
function JMIN (X, Y: INTEGER) return INTEGER;
function JMAX (X, Y: INTEGER) return INTEGER;
end cpu_pkg;
@@ -260,34 +260,34 @@ package body cpu_pkg is
end Instr;
function Instr(opcode : opcode_t; reg_a : integer) return inst_t is
function Instr(opcode : opcode_t; reg_ptr_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));
inst(reg_ptr_t'length-1 downto 0) := reg_ptr_t(to_unsigned(reg_ptr_a, reg_ptr_t'length));
return inst;
end Instr;
function Instr(opcode : opcode_t; reg_a, reg_b : integer) return inst_t is
function Instr(opcode : opcode_t; reg_ptr_a, reg_ptr_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));
inst(2*(reg_ptr_t'length)-1 downto reg_ptr_t'length) := reg_ptr_t(to_unsigned(reg_ptr_b, reg_ptr_t'length));
inst(reg_ptr_t'length-1 downto 0) := reg_ptr_t(to_unsigned(reg_ptr_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
function Instr(opcode : opcode_t; reg_ptr_a, reg_ptr_b, reg_ptr_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));
inst(3*(reg_ptr_t'length)-1 downto 2*reg_ptr_t'length) := reg_ptr_t(to_unsigned(reg_ptr_c, reg_ptr_t'length));
inst(2*(reg_ptr_t'length)-1 downto reg_ptr_t'length) := reg_ptr_t(to_unsigned(reg_ptr_b, reg_ptr_t'length));
inst(reg_ptr_t'length-1 downto 0) := reg_ptr_t(to_unsigned(reg_ptr_a, reg_ptr_t'length));
return inst;
@@ -824,7 +824,7 @@ package body cpu_pkg is
end get_muromaddr;
-------------------------------------------------------------
function MIN (X, Y: INTEGER) return INTEGER is
function JMIN (X, Y: INTEGER) return INTEGER is
variable res : integer := X;
begin
if Y < X then
@@ -833,10 +833,10 @@ package body cpu_pkg is
return res;
end MIN;
end JMIN;
-------------------------------------------------------------
function MAX (X, Y: INTEGER) return INTEGER is
function JMAX (X, Y: INTEGER) return INTEGER is
variable res : integer := X;
begin
if Y > X then
@@ -845,7 +845,7 @@ package body cpu_pkg is
return res;
end MAX;
end JMAX;
end cpu_pkg;
@@ -0,0 +1,229 @@
-------------------------------------------------------------------------
-- 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;
use work.uart_types.all;
entity cpu_embedded_with_uart 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_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;
uart_tx : out STD_LOGIC;
uart_rx : in STD_LOGIC
);
end cpu_embedded_with_uart;
architecture rtl of cpu_embedded_with_uart is
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_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;
signal cpu_irom_addr : inst_addr_t;
signal cpu_xmem_addr : dmem_addr_t;
signal cpu_xmem_din : dmem_data_t;
signal cpu_xmem_dout : dmem_data_t;
signal cpu_io_sel : STD_LOGIC;
signal cpu_xmem_we : STD_LOGIC;
signal cpu_xmem_re : STD_LOGIC;
COMPONENT irom
Port
(
clk : in STD_LOGIC;
ce : in STD_LOGIC;
addr : in inst_addr_t;
dout : out inst_t
);
END COMPONENT;
signal irom_data : inst_t;
COMPONENT xrom
Port
(
clk : in STD_LOGIC;
ce : in STD_LOGIC;
addr : in dmem_addr_t;
dout : out dmem_data_t
);
END COMPONENT;
signal rom_xmem_dout : dmem_data_t;
signal reg_xmem_dout : dmem_data_t;
signal uart_tx_we : STD_LOGIC;
signal uart_rx_re : STD_LOGIC;
signal uart_tx_din : unsigned(7 downto 0);
signal uart_rx_dout : unsigned(7 downto 0);
signal uart_ctrl : ctrl_t;
signal uart_status : status_t;
COMPONENT uart
Generic
(
fifo_depth_bits : integer := 4
);
Port
(
clk : in STD_LOGIC;
rst : in STD_LOGIC;
we : in STD_LOGIC;
re : in STD_LOGIC;
din : in unsigned(7 downto 0);
dout : out unsigned(7 downto 0);
ser_rx : in std_logic;
ser_tx : out std_logic;
ctrl : in ctrl_t;
status : out status_t
);
END COMPONENT;
begin
cpu_xmem_din <= rom_xmem_dout when cpu_io_sel = '0' else reg_xmem_dout;
inst_cpu: cpu
PORT MAP
(
rst => rst,
clk => clk,
ce => ce,
int_in => int_in,
int_ack => int_ack,
xmem_we => cpu_xmem_we,
xmem_re => cpu_xmem_re,
instr_din => irom_data,
instr_addr => cpu_irom_addr,
xmem_din => cpu_xmem_din,
xmem_dout => cpu_xmem_dout,
xmem_addr => cpu_xmem_addr,
io_sel => cpu_io_sel
);
inst_irom: irom
PORT MAP
(
clk => clk,
ce => ce,
addr => cpu_irom_addr,
dout => irom_data
);
inst_xrom: entity work.xrom
PORT MAP
(
clk => clk,
ce => ce,
addr => cpu_xmem_addr,
dout => rom_xmem_dout
);
inst_uart : uart
PORT MAP
(
rst => rst,
clk => clk,
we => uart_tx_we,
re => uart_rx_re,
din => uart_tx_din,
dout => uart_rx_dout,
ser_tx => uart_tx,
ser_rx => uart_rx,
ctrl => uart_ctrl,
status => uart_status
);
uart_tx_din <= cpu_xmem_dout;
cpu_reg_read:
process(clk)
variable reg : dmem_data_t;
begin
if rising_edge(clk) then
uart_rx_re <= '0';
case cpu_xmem_addr is
when X"02" =>
uart_rx_re <= '1';
reg_xmem_dout <= uart_rx_dout;
when X"06" =>
reg_xmem_dout <= '0' & '0' & '0' & uart_status.rx_present & '0' & uart_status.tx_complete & uart_status.tx_full & uart_status.tx_empty;
when others => null;
end case;
end if;
end process;
------------------------------------------------------------------
cpu_reg_write:
process(clk)
begin
if rising_edge(clk) then
uart_tx_we <= '0';
if cpu_xmem_we = '1' then
if cpu_io_sel = '1' then
case cpu_xmem_addr is
when X"02" =>
uart_tx_we <= '1';
when others => null;
end case;
end if;
end if;
end if;
end process;
end rtl;
+186
View File
@@ -0,0 +1,186 @@
-------------------------------------------------------------------------
-- 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 hallo_welt_uart OF irom IS
type imem_rom_t is array (0 to 124) of inst_t;
-- Assembled from hallo_welt_uart.jsm
constant imem_rom : imem_rom_t :=
(
"110000" & X"002", -- 0x000: JMP 0x002
"111111" & X"000", -- 0x001: RETI
"101000" & X"020", -- 0x002: XIN R00, (0x02)
"111011" & X"029", -- 0x003: CALL 0x029
"111011" & X"039", -- 0x004: CALL 0x039
"000010" & X"010", -- 0x005: MOV R00, R01
"111011" & X"039", -- 0x006: CALL 0x039
"000011" & X"001", -- 0x007: MOV R01, 0x00
"111011" & X"030", -- 0x008: CALL 0x030
"000011" & X"031", -- 0x009: MOV R01, 0x03
"111011" & X"030", -- 0x00A: CALL 0x030
"101001" & X"000", -- 0x00B: CIN R00, (0x00)
"010001" & X"300", -- 0x00C: ADD R00, 0x30
"111011" & X"039", -- 0x00D: CALL 0x039
"000011" & X"001", -- 0x00E: MOV R01, 0x00
"111011" & X"030", -- 0x00F: CALL 0x030
"000011" & X"0D1", -- 0x010: MOV R01, 0x0D
"111011" & X"030", -- 0x011: CALL 0x030
"000011" & X"161", -- 0x012: MOV R01, 0x16
"111011" & X"030", -- 0x013: CALL 0x030
"000011" & X"A0F", -- 0x014: MOV R15, 0xA0
"001111" & X"00F", -- 0x015: TST R15
"110001" & X"020", -- 0x016: JZ 0x020
"010101" & X"01F", -- 0x017: DEC R15
"000011" & X"301", -- 0x018: MOV R01, 0x30
"001111" & X"3A1", -- 0x019: CMP R01, 0x3A
"111001" & X"01F", -- 0x01A: JEQ 0x01F
"000010" & X"010", -- 0x01B: MOV R00, R01
"010001" & X"011", -- 0x01C: INC R01
"111011" & X"039", -- 0x01D: CALL 0x039
"110000" & X"019", -- 0x01E: JMP 0x019
"110000" & X"015", -- 0x01F: JMP 0x015
"000011" & X"001", -- 0x020: MOV R01, 0x00
"111011" & X"030", -- 0x021: CALL 0x030
"110000" & X"009", -- 0x022: JMP 0x009
"011001" & X"0F0", -- 0x023: AND R00, 0x0F
"001111" & X"0A0", -- 0x024: CMP R00, 0x0A
"110101" & X"027", -- 0x025: JLT 0x027
"010001" & X"070", -- 0x026: ADD R00, 0x07
"010001" & X"300", -- 0x027: ADD R00, 0x30
"111110" & X"000", -- 0x028: RET
"111100" & X"000", -- 0x029: PUSH R00
"111011" & X"023", -- 0x02A: CALL 0x023
"000010" & X"001", -- 0x02B: MOV R01, R00
"111101" & X"000", -- 0x02C: POP R00
"101010" & X"000", -- 0x02D: SWAP R00
"111011" & X"023", -- 0x02E: CALL 0x023
"111110" & X"000", -- 0x02F: RET
"111100" & X"000", -- 0x030: PUSH R00
"000100" & X"010", -- 0x031: MOVX R00, (R01)
"010001" & X"011", -- 0x032: INC R01
"001111" & X"000", -- 0x033: TST R00
"110001" & X"037", -- 0x034: JZ 0x037
"111011" & X"039", -- 0x035: CALL 0x039
"110000" & X"031", -- 0x036: JMP 0x031
"111101" & X"000", -- 0x037: POP R00
"111110" & X"000", -- 0x038: RET
"110000" & X"03A", -- 0x039: JMP 0x03A
"111100" & X"001", -- 0x03A: PUSH R01
"101000" & X"061", -- 0x03B: XIN R01, (0x06)
"011001" & X"021", -- 0x03C: AND R01, 0x02
"110010" & X"03B", -- 0x03D: JNZ 0x03B
"100100" & X"020", -- 0x03E: XOUT (0x02), R00
"111101" & X"001", -- 0x03F: POP R01
"111110" & X"000", -- 0x040: RET
"111100" & X"001", -- 0x041: PUSH R01
"101000" & X"061", -- 0x042: XIN R01, (0x06)
"011001" & X"101", -- 0x043: AND R01, 0x10
"110010" & X"042", -- 0x044: JNZ 0x042
"101000" & X"020", -- 0x045: XIN R00, (0x02)
"111101" & X"001", -- 0x046: POP R01
"111110" & X"000", -- 0x047: RET
"111100" & X"00F", -- 0x048: PUSH R15
"000011" & X"0AF", -- 0x049: MOV R15, 0x0A
"111011" & X"04F", -- 0x04A: CALL 0x04F
"010101" & X"01F", -- 0x04B: DEC R15
"110010" & X"04A", -- 0x04C: JNZ 0x04A
"111101" & X"00F", -- 0x04D: POP R15
"111110" & X"000", -- 0x04E: RET
"111100" & X"00F", -- 0x04F: PUSH R15
"000011" & X"0AF", -- 0x050: MOV R15, 0x0A
"111011" & X"056", -- 0x051: CALL 0x056
"010101" & X"01F", -- 0x052: DEC R15
"110010" & X"051", -- 0x053: JNZ 0x051
"111101" & X"00F", -- 0x054: POP R15
"111110" & X"000", -- 0x055: RET
"111100" & X"00F", -- 0x056: PUSH R15
"000011" & X"0AF", -- 0x057: MOV R15, 0x0A
"111011" & X"05D", -- 0x058: CALL 0x05D
"010101" & X"01F", -- 0x059: DEC R15
"110010" & X"058", -- 0x05A: JNZ 0x058
"111101" & X"00F", -- 0x05B: POP R15
"111110" & X"000", -- 0x05C: RET
"111100" & X"00F", -- 0x05D: PUSH R15
"000011" & X"0AF", -- 0x05E: MOV R15, 0x0A
"111011" & X"064", -- 0x05F: CALL 0x064
"010101" & X"01F", -- 0x060: DEC R15
"110010" & X"05F", -- 0x061: JNZ 0x05F
"111101" & X"00F", -- 0x062: POP R15
"111110" & X"000", -- 0x063: RET
"111100" & X"00F", -- 0x064: PUSH R15
"000011" & X"0AF", -- 0x065: MOV R15, 0x0A
"111011" & X"06B", -- 0x066: CALL 0x06B
"010101" & X"01F", -- 0x067: DEC R15
"110010" & X"066", -- 0x068: JNZ 0x066
"111101" & X"00F", -- 0x069: POP R15
"111110" & X"000", -- 0x06A: RET
"111100" & X"00F", -- 0x06B: PUSH R15
"000011" & X"63F", -- 0x06C: MOV R15, 0x63
"000000" & X"000", -- 0x06D: NOP
"000000" & X"000", -- 0x06E: NOP
"000000" & X"000", -- 0x06F: NOP
"010101" & X"01F", -- 0x070: DEC R15
"110010" & X"06D", -- 0x071: JNZ 0x06D
"111101" & X"00F", -- 0x072: POP R15
"111110" & X"000", -- 0x073: RET
"111100" & X"00F", -- 0x074: PUSH R15
"000011" & X"09F", -- 0x075: MOV R15, 0x09
"000000" & X"000", -- 0x076: NOP
"000000" & X"000", -- 0x077: NOP
"000000" & X"000", -- 0x078: NOP
"010101" & X"01F", -- 0x079: DEC R15
"110010" & X"076", -- 0x07A: JNZ 0x076
"111101" & X"00F", -- 0x07B: POP R15
"111110" & X"000" -- 0x07C: 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 hallo_welt_uart;
File diff suppressed because it is too large Load Diff
+317
View File
@@ -0,0 +1,317 @@
-------------------------------------------------------------------------
-- 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 hallo_welt_uart OF xrom IS
type xmem_rom_t is array (0 to 255) of dmem_data_t;
-- Assembled from hallo_welt_uart.jsm
constant xmem_rom : xmem_rom_t :=
(
X"0D", -- 0x00
X"0A", -- 0x01
X"00", -- 0x02
X"4A", -- 0x03
X"2D", -- 0x04
X"43", -- 0x05
X"50", -- 0x06
X"55", -- 0x07
X"20", -- 0x08
X"56", -- 0x09
X"31", -- 0x0A
X"2E", -- 0x0B
X"00", -- 0x0C
X"52", -- 0x0D
X"65", -- 0x0E
X"61", -- 0x0F
X"64", -- 0x10
X"79", -- 0x11
X"2E", -- 0x12
X"0D", -- 0x13
X"0A", -- 0x14
X"00", -- 0x15
X"4D", -- 0x16
X"69", -- 0x17
X"6D", -- 0x18
X"69", -- 0x19
X"20", -- 0x1A
X"69", -- 0x1B
X"73", -- 0x1C
X"74", -- 0x1D
X"20", -- 0x1E
X"65", -- 0x1F
X"69", -- 0x20
X"6E", -- 0x21
X"65", -- 0x22
X"20", -- 0x23
X"6C", -- 0x24
X"69", -- 0x25
X"65", -- 0x26
X"62", -- 0x27
X"65", -- 0x28
X"20", -- 0x29
X"4B", -- 0x2A
X"61", -- 0x2B
X"74", -- 0x2C
X"7A", -- 0x2D
X"65", -- 0x2E
X"20", -- 0x2F
X"21", -- 0x30
X"21", -- 0x31
X"21", -- 0x32
X"0D", -- 0x33
X"0A", -- 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 hallo_welt_uart;
@@ -0,0 +1,413 @@
-------------------------------------------------------------------------
-- 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 hallo_welt_uart.jsm
type xmem_rom_t is array (0 to 255) of dmem_data_t;
signal xmem_rom : xmem_rom_t :=
(
X"0D", -- 0x00
X"0A", -- 0x01
X"00", -- 0x02
X"4A", -- 0x03
X"2D", -- 0x04
X"43", -- 0x05
X"50", -- 0x06
X"55", -- 0x07
X"20", -- 0x08
X"56", -- 0x09
X"31", -- 0x0A
X"2E", -- 0x0B
X"00", -- 0x0C
X"52", -- 0x0D
X"65", -- 0x0E
X"61", -- 0x0F
X"64", -- 0x10
X"79", -- 0x11
X"2E", -- 0x12
X"0D", -- 0x13
X"0A", -- 0x14
X"00", -- 0x15
X"4D", -- 0x16
X"69", -- 0x17
X"6D", -- 0x18
X"69", -- 0x19
X"20", -- 0x1A
X"69", -- 0x1B
X"73", -- 0x1C
X"74", -- 0x1D
X"20", -- 0x1E
X"65", -- 0x1F
X"69", -- 0x20
X"6E", -- 0x21
X"65", -- 0x22
X"20", -- 0x23
X"6C", -- 0x24
X"69", -- 0x25
X"65", -- 0x26
X"62", -- 0x27
X"65", -- 0x28
X"20", -- 0x29
X"4B", -- 0x2A
X"61", -- 0x2B
X"74", -- 0x2C
X"7A", -- 0x2D
X"65", -- 0x2E
X"20", -- 0x2F
X"21", -- 0x30
X"21", -- 0x31
X"21", -- 0x32
X"0D", -- 0x33
X"0A", -- 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;
-1
View File
@@ -102,7 +102,6 @@ STIMULUS: process
wait for 1000*CLK_PERIOD;
assert false report "Test finished" severity error;
wait;
end process;
@@ -0,0 +1,132 @@
-------------------------------------------------------------------------
-- 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_with_uart IS
END tb_cpu_embedded_with_uart;
ARCHITECTURE behavior OF tb_cpu_embedded_with_uart IS
COMPONENT cpu_embedded_with_uart
Port (
rst : in STD_LOGIC;
clk : in STD_LOGIC;
ce : in STD_LOGIC;
int_in : in STD_LOGIC;
int_ack : out 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;
uart_tx : out STD_LOGIC;
uart_rx : in 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_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);
signal uart_tx : std_logic;
signal uart_rx : std_logic := '1';
BEGIN
uut: cpu_embedded_with_uart
PORT MAP
(
rst => rst,
clk => clk,
ce => ce,
int_in => int_in,
int_ack => int_ack,
xmem_we => xmem_we,
xmem_re => xmem_re,
xmem_din => xmem_din,
xmem_dout => xmem_dout,
xmem_addr => xmem_addr,
io_sel => io_sel,
uart_tx => uart_tx,
uart_rx => uart_rx
);
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;
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;
-1
View File
@@ -160,7 +160,6 @@ STIMULUS: process
wait for 300*CLK_PERIOD;
end loop;
assert false report "Test finished" severity error;
wait;
end process;
+4 -2
View File
@@ -135,10 +135,11 @@ CLK_GEN: process
end process;
STIMULUS: process
file RESULT: text open write_mode is "../tools/opc.list";
file RESULT: text;
variable L: line;
begin
file_open(RESULT, "../tools/opc.list", WRITE_MODE);
for i in 0 to instr_name_array'length-1 loop
fprint(RESULT, L,"%d %s\n", fo(i), instr_name_array(i));
@@ -151,7 +152,8 @@ STIMULUS: process
wait until rising_edge(clk);
ce <= '1';
assert false report "Test finished" severity error;
file_close(RESULT);
wait;
end process;
+10 -10
View File
@@ -1,10 +1,10 @@
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"
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"
+15 -18
View File
@@ -33,7 +33,7 @@ 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"
OPC_LIST_NAME = __dir__ + "/opc.list"
# --------------------------------------------------------
class Parser
@@ -179,6 +179,7 @@ file.each do |raw_line|
end
token = iline_member[mc]
mcnt = iline_member.count{|x| !x.nil?}
if token
token = token.upcase
end
@@ -209,7 +210,7 @@ file.each do |raw_line|
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))
curr_addr = format("0x%2.2X",eval(iline_member[mc+1..mcnt][0].to_s))
else
curr_addr = iline_member[mc+1]
end
@@ -218,7 +219,7 @@ file.each do |raw_line|
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)
offset = eval(iline_member[mc+1..mcnt][0].to_s)
case obj.curr_segment
when "CODE"
obj.pc = offset
@@ -259,17 +260,13 @@ file.each do |raw_line|
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
value = str[nn].ord
obj.put_xmem(value, lc);
len += 1
end;
else
argument = item
puts "B: " + argument
obj.put_xmem(eval(argument), lc);
len += 1
end
@@ -307,14 +304,14 @@ file.each do |raw_line|
exit 1
end
op_line = iline_member[mc+1..iline_member.nitems].to_s
op_line = iline_member[mc+1..mcnt]
curr_addr = format("0x%3.3X",obj.pc)
opc = token
if iline_member[mc+1] != nil
op1 = op_line.gsub(/,+.*$/, "")
op1 = op_line[0].to_s.gsub(/,+.*$/, "")
end
if iline_member[mc+2] != nil
op2 = op_line.scan(/,.+$/).to_s.delete(", ")
op2 = op_line[1].to_s.gsub(/,+.*$/, "")
end
obj.put_instr(name, lc, opc, op1, op2)
obj.pc = obj.pc + 1
@@ -383,7 +380,7 @@ end
# --------------------------------------------------------
# Open file
# --------------------------------------------------------
filename = arg.to_s
filename = arg[0].to_s
if !File.exists?(filename)
STDERR.puts "#{filename} does not exist"
exit 1
@@ -743,10 +740,10 @@ if num_errors == 0
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)
file.puts format("\t\tX\"%2.2X\", -- 0x%2.2X\n", first_pass.xmem[i].to_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\tX\"%2.2X\" -- 0x%2.2X\n", first_pass.xmem[i].to_i(), i)
file.puts format("\t);\n")
file.puts format("\n")
file.puts format("begin")
@@ -772,10 +769,10 @@ if num_errors == 0
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)
file.puts format("\t\tX\"%2.2X\", -- 0x%2.2X\n", first_pass.xmem[i].to_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\tX\"%2.2X\" -- 0x%2.2X\n", first_pass.xmem[i].to_i(), i)
file.puts format("\t);\n")
puts format("X-ROM (loadable) file written to \"%s\"\n",filename)
file.close
+28 -2
View File
@@ -4,6 +4,31 @@
; needs xmem-address definition for
; - uart_status (Status register)
; - uart_data (Data register)
UART_TX_EMPTY: equ 0x01
UART_TX_FULL: equ 0x02
UART_TX_CMPL: equ 0x04
UART_RX_PRESENT: equ 0x10
; -------------------------------------------------
; uart_puts
; -------------------------------------------------
; R1 : ptr to string
uart_puts: push R0
u_p_lp: movx R0, (R1)
inc R1
tst R0
jz ex_ugp
call uart_putchar
jmp u_p_lp
ex_ugp: pop R0
ret
; -------------------------------------------------
; uart_putchar
; -------------------------------------------------
; R0 = input
uart_putchar: jmp sout
; -------------------------------------------------
; sout
@@ -11,7 +36,7 @@
; R0 = input
sout: push R1
sout1: xin R1, (uart_status)
and R1, 0x02
and R1, UART_TX_FULL
jnz sout1
xout (uart_data), R0
pop R1
@@ -23,10 +48,11 @@ sout1: xin R1, (uart_status)
; R0 = output
sin: push R1
sin1: xin R1, (uart_status)
and R1, 0x10
and R1, UART_RX_PRESENT
jnz sin1
xin R0, (uart_data)
pop R1
ret
; -------------------------------------------------
@@ -1,34 +0,0 @@
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
@@ -1,87 +0,0 @@
/************************************************************************/
/* 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
@@ -1,333 +0,0 @@
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
@@ -1,359 +0,0 @@
/*
* 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
@@ -1,42 +0,0 @@
/*
* 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
@@ -1,76 +0,0 @@
/*
* 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
@@ -1,358 +0,0 @@
#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
@@ -1,322 +0,0 @@
#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;
}
@@ -1,84 +0,0 @@
#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
@@ -1,71 +0,0 @@
/*
* 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;
}
@@ -1,47 +0,0 @@
ENDIAN='big'
ifeq ($(ENDIAN), 'big')
ENDIAN_FLAGS=-EB
LIB_DIRS=-L $(MIPS_TOOLS_PREFIX)/mipsel-elf/lib/eb -L $(MIPS_TOOLS_PREFIX)/lib/gcc/mipsel-elf/$(MIPS_GCC_VER)/eb
else
ENDIAN_FLAGS=-EL
LIB_DIRS=-L $(MIPS_TOOLS_PREFIX)/mipsel-elf/lib -L $(MIPS_TOOLS_PREFIX)/lib/gcc/mipsel-elf/$(MIPS_GCC_VER)
endif
CFLAGS=$(ENDIAN_FLAGS) -Os -I. -I../ -I../libsys -msoft-float -march=r3000
LFLAGS=$(ENDIAN_FLAGS) -M -T bootloader.ld
LIBS=-lc -lgcc
CC=mipsel-elf-gcc
LD=mipsel-elf-ld
OBJDUMP=mipsel-elf-objdump
OBJCOPY=mipsel-elf-objcopy
all: bootloader_flash
libsys: startup_boot.S init_boot.S kernel_boot.S libsys_boot.c
$(CC) $(CFLAGS) -c startup_boot.S -o startup.o
$(CC) $(CFLAGS) -c init_boot.S -o init.o
$(CC) $(CFLAGS) -c kernel_boot.S -o kernel.o
$(CC) $(CFLAGS) -c libsys_boot.c -o libsys.o
bootloader: libsys bootloader.c
$(CC) $(CFLAGS) -g -c bootloader.c
$(LD) $(LFLAGS) $(LIB_DIRS) startup.o init.o kernel.o libsys.o bootloader.o -o bootloader.elf $(LIBS) >bootloader.map
$(OBJDUMP) -d bootloader.elf > bootloader.dis
$(OBJCOPY) bootloader.elf -O binary bootloader.ROM.bin
$(OBJCOPY) -O srec bootloader.elf bootloader.srec
romgen bootloader.ROM.bin 10 $(ENDIAN_FLAGS)
bootloader_flash: libsys bootloader_with_flash.c
$(CC) $(CFLAGS) -g -c bootloader_with_flash.c
$(CC) $(CFLAGS) -g -c ../cfiflash.c
$(LD) $(LFLAGS) $(LIB_DIRS) startup.o init.o kernel.o libsys.o cfiflash.o bootloader_with_flash.o -o bootloader.elf $(LIBS) >bootloader.map
$(OBJDUMP) -d bootloader.elf > bootloader.dis
$(OBJCOPY) bootloader.elf -O binary bootloader.ROM.bin
$(OBJCOPY) -O srec bootloader.elf bootloader.srec
romgen bootloader.ROM.bin 11 $(ENDIAN_FLAGS)
clean:
rm -rf *.o *.bin *.map *.dis *.srec *.elf *.vhd* *.tcl bootloader > /dev/null
@@ -1,247 +0,0 @@
#include "libsys_boot.h"
typedef struct _ssrec_t
{
UINT32 addr;
UINT32 size;
UINT32 type;
UINT8 *data;
} srec_t;
enum srec_type
{
srec_err, srec_sob, srec_data, srec_rec, srec_eob
};
UINT8 h2i(UINT8 *c)
{
int i;
UINT8 t, b = 0;
for (i=0; i < 2; i++)
{
t = c[i];
if (t >= 'A')
t = t - 'A' + 10;
else
t -= '0';
b = (b << 4) | t;
}
return b;
}
int decode_srec(srec_t *pRec, UINT8 *pBuf, int buflen)
{
UINT8 chksum, byte;
int alen, i;
if (!buflen)
return srec_err;
pRec->type = srec_rec;
alen = 0;
if ((pBuf[1] > '0') && (pBuf[1] < '4'))
{
alen = pBuf[1] - '0' + 1;
pRec->type = srec_data;
}
else if ((pBuf[1] >= '7') && (pBuf[1] <= '9'))
{
alen = 11 - (pBuf[1] - '0');
pRec->type = srec_eob;
}
else if (pBuf[1] == '0')
{
alen = 2;
pRec->type = srec_sob;
}
byte = h2i(&pBuf[2]);
pRec->size = byte;
chksum = byte;
pRec->addr = 0;
for (i=0; i < alen; i++)
{
byte = h2i(&pBuf[4+2*i]);
pRec->addr = pRec->addr << 8 | byte;
chksum += byte;
}
pRec->size -= (alen+1);
pRec->data = (UINT8*) &pBuf[4 + 2*alen];
for (i=0; i < (int)pRec->size; i++)
{
byte = h2i(&pRec->data[2*i]);
pRec->data[i] = byte;
chksum += byte;
}
chksum = ~chksum;
byte = h2i(&pRec->data[2*i]);
if (chksum != byte)
return 0;
return pRec->type;
}
int srec_getline(UINT8 *pLine)
{
char c;
int i = 0;
do
{
c = readchar();
} while ((c != 's') && (c != 'S'));
while(((c != 0x0D) && (c != 0x0A)))
{
pLine[i++] = c;
c = readchar();
};
return i;
}
void Jump_to(void *pEntry)
{
__asm
(
".set noreorder\n"
);
__asm
(
"jr %[pEntry]\n" // jump entry
:
: [pEntry] "r" (pEntry)
);
__asm
(
"nop\n"
);
__asm
(
".set reorder\n"
);
}
void Exec_at(void *pEntry)
{
__asm
(
".set noreorder\n"
);
__asm
(
"mfc0 $26, $12\n" // change exception vector
"li $27, 0xFFBFFFFF\n"
"and $26, $27\n"
"mtc0 $26, $12\n"
);
__asm
(
"lw $v0, 16($sp)\n"
"nop\n"
"jr $v0\n" // jump entry
"rfe\n"
);
__asm
(
".set reorder\n"
);
}
void PrintCPUinfo(void)
{
int result, rev_id;
char *cpu_type_str[7] = {"invalid", "R2000", "R3000", "R6000", "R4000", "reserved", "R6000A"};
// Print Status register
result = CP0_SR_read();
sputs("Status : ");
print_word(result);
sputs("\n");
// Print Revision
result = CP0_PRID_read();
rev_id = (result >> 8) & 0xFF;
sputs("CPU type: ");
if ((rev_id > 0) && (rev_id < 0x07))
{
sputs(cpu_type_str[rev_id]);
sputs(" Rev.");
rev_id = result & 0xFF;
print_byte((char)rev_id);
}
else
sputs("Unknown");
sputs("\n");
}
#define MAX_IMG_SIZE (1024*1024) // bytes
int main(int argc, char *argv[])
{
UINT8 buf[256];
srec_t srec;
int result, srec_state, i;
UINT32 haddr;
volatile UINT8 *pMem;
haddr = 0;
// ----------------------------------------------------------
sputs("\n\n");
PrintCPUinfo();
sputs("Booting from UART..");
while(1)
{
sputs(".");
while(1)
{
result = srec_getline(buf);
srec_state = decode_srec(&srec, buf, result);
switch (srec_state)
{
case srec_data:
if ((srec.addr + srec.size) > haddr)
haddr = srec.addr + srec.size;
pMem = (UINT8*)srec.addr;
for (i=0; i < srec.size; i++)
*pMem++ = srec.data[i];
break;
case srec_eob:
sputs("done\n\n");
sputs("Execute program at ");
print_word(srec.addr);
sputs("\n\n");
Exec_at((void*)srec.addr);
break;
default:
result = -1;
break;
}
if (result < 0)
{
break;
}
};
}
return 0;
}
@@ -1,53 +0,0 @@
MEMORY
{
rom : ORIGIN = 0xBFC00000, LENGTH = 0x00002000 /* 8K */
ram : ORIGIN = 0x40000000, LENGTH = 0x00002000 /* 8K */
}
OUTPUT_ARCH(mips)
SEARCH_DIR(".");
SEARCH_DIR("/usr/local/mipsel-elf/lib:/usr/local/mipsel-elf/lib/eb");
SEARCH_DIR("/usr/local/lib/gcc/mipsel-elf/4.3.3:/usr/local/lib/gcc/mipsel-elf/4.3.3/eb");
stack_ptr = 0x7FFFEFF0;
baudrate = 0x0D;
sys_led_port = 0xA0000000;
sys_uart_data = 0xA0010000;
sys_uart_stat = 0xA0010004;
sys_uart_baud = 0xA0010008;
sys_timer_usec = 0xA000008;
sys_timer_sec = 0xA000000C;
SECTIONS
{
.init ORIGIN(rom) :
{
start = ALIGN(4);
entry = ALIGN(4);
_entry = ALIGN(4);
__entry = ALIGN(4);
*(.stext)
} > rom
.ktext ORIGIN(rom) + 0x180 :
{
*(.ktext)
} > rom
.text . :
{
*(.text)
} > rom
.rodata . :
{
*(.rodata*)
} > rom
.data ORIGIN(ram) :
{
*(.*data) *(.*bss) *(.*common)
} > ram
}
@@ -1,383 +0,0 @@
#include "libsys_boot.h"
#include "cfiflash.h"
#define MAGIC_EB 0x4A464931 // "JFI1" in big-endian;
#define MAGIC_EL 0x3149464A // "JFI1" in little-endian;
typedef struct _ssrec_t
{
UINT32 addr;
UINT32 size;
UINT32 type;
UINT8 *data;
} srec_t;
typedef struct _sflash_alloc_tbl_t
{
UINT32 images[16];
} flash_alloc_tbl_t;
typedef struct _sflash_img_hdr_t
{
UINT32 magic;
UINT32 target_base;
UINT32 img_base;
UINT32 img_size;
UINT32 hdr_next;
UINT8 img_name[128];
UINT8 res[108];
} flash_img_hdr_t;
enum srec_type
{
srec_err, srec_sob, srec_data, srec_rec, srec_eob
};
UINT8 h2i(UINT8 *c)
{
int i;
UINT8 t, b = 0;
for (i=0; i < 2; i++)
{
t = c[i];
if (t >= 'A')
t = t - 'A' + 10;
else
t -= '0';
b = (b << 4) | t;
}
return b;
}
int decode_srec(srec_t *pRec, UINT8 *pBuf, int buflen)
{
UINT8 chksum, byte;
int alen, i;
if (!buflen)
return srec_err;
pRec->type = srec_rec;
alen = 0;
if ((pBuf[1] > '0') && (pBuf[1] < '4'))
{
alen = pBuf[1] - '0' + 1;
pRec->type = srec_data;
}
else if ((pBuf[1] >= '7') && (pBuf[1] <= '9'))
{
alen = 11 - (pBuf[1] - '0');
pRec->type = srec_eob;
}
else if (pBuf[1] == '0')
{
alen = 2;
pRec->type = srec_sob;
}
byte = h2i(&pBuf[2]);
pRec->size = byte;
chksum = byte;
pRec->addr = 0;
for (i=0; i < alen; i++)
{
byte = h2i(&pBuf[4+2*i]);
pRec->addr = pRec->addr << 8 | byte;
chksum += byte;
}
pRec->size -= (alen+1);
pRec->data = (UINT8*) &pBuf[4 + 2*alen];
for (i=0; i < (int)pRec->size; i++)
{
byte = h2i(&pRec->data[2*i]);
pRec->data[i] = byte;
chksum += byte;
}
chksum = ~chksum;
byte = h2i(&pRec->data[2*i]);
if (chksum != byte)
return 0;
return pRec->type;
}
int srec_getline(UINT8 *pLine)
{
char c;
int i = 0;
do
{
c = readchar();
} while ((c != 's') && (c != 'S'));
while(((c != 0x0D) && (c != 0x0A)))
{
pLine[i++] = c;
c = readchar();
};
return i;
}
void Jump_to(void *pEntry)
{
__asm
(
".set noreorder\n"
);
__asm
(
"jr %[pEntry]\n" // jump entry
:
: [pEntry] "r" (pEntry)
);
__asm
(
"nop\n"
);
__asm
(
".set reorder\n"
);
}
void Exec_at(void *pEntry)
{
__asm
(
".set noreorder\n"
);
__asm
(
"li $26, 0x10000000\n"
"mtc0 $26, $12\n"
);
__asm
(
"jr %[pEntry]\n" // jump entry
:
: [pEntry] "r" (pEntry)
);
__asm
(
"rfe\n"
);
__asm
(
".set reorder\n"
);
}
void Exec_RE_at(void *pEntry)
{
__asm
(
".set noreorder\n"
);
__asm
(
"mfc0 $26, $12\n" // change exception vector
"li $27, 0xFFBFFFFF\n"
"and $26, $27\n"
"li $27, 0x02000000\n" // Reverse Endianess
"or $26, $27\n"
"mtc0 $26, $12\n"
);
__asm
(
"jr %[pEntry]\n" // jump entry
:
: [pEntry] "r" (pEntry)
);
__asm
(
"rfe\n"
);
__asm
(
".set reorder\n"
);
}
#define MAX_IMG_SIZE (1024*1024) // bytes
#define SDRAM_BASE 0x40000000
#define FLASH_USE_BLOCK 1
int main(int argc, char *argv[])
{
UINT8 buf[256];
srec_t srec;
int srec_state, i;
UINT32 haddr, result;
flash_t flash;
flash_img_hdr_t img_hdr = {0};
flash_img_hdr_t *pImg_hdr;
UINT32 img_size, block_sel;
volatile UINT32 *pLED = (UINT32*)SYS_LED_PORT;
volatile UINT32 *pBtn = (UINT32*)SYS_GPIO0;
volatile UINT32 *pDip = (UINT32*)SYS_GPIO1;
volatile UINT8 *pMem;
volatile UINT32 *pFlashIO = (UINT32*)SYS_FLASH_IO; // Flash in uncached area
volatile UINT32 *pFlashMem = (UINT32*)SYS_FLASH_MEM; // Flash in cached area
volatile UINT32 *ram32 = (UINT32*)SDRAM_BASE;
UINT32 flash_offset;
*pLED = 0;
haddr = 0;
block_sel = 0x7F & (UINT32)*pDip;
// ----------------------------------------------------------
if (IS_ERROR(flash_find(&flash, SYS_FLASH_IO)))
{
sputs("Cannot find flash device. Exit now!\n\n");
return 1;
}
// Get flash offset by value of DIP-switch
flash_offset = flash_get_offset_by_blocknum(&flash, block_sel);
ram32 = (UINT32*)(SDRAM_BASE);
pFlashIO = (UINT32*)(SYS_FLASH_IO + flash_offset);
if (!(*pBtn & 8))
{
sputs("\n\n");
pImg_hdr = (flash_img_hdr_t*)pFlashIO;
if ((pImg_hdr->magic != MAGIC_EL) && (pImg_hdr->magic != MAGIC_EB))
{
sputs("\n\n");
sputs("Invalid image found at ");print_word(flash_offset); sputs(". Abort.\n");
return 1;
}
sputs("Booting application from flash (");print_word(flash_offset);sputs(")...");
ram32 = (UINT32*)pImg_hdr->target_base;
img_size = pImg_hdr->img_size;
// It's safe to use cached Flash,
// because D-Cache was invalidated during execution of start code
pFlashMem = (UINT32*)(SYS_FLASH_MEM + pImg_hdr->img_base);
for (i=0; i < img_size/4; i++)
ram32[i] = pFlashMem[i];
sputs("done\n");
sputs("Execute at ");print_word(pImg_hdr->target_base); sputs("\n\n");
Exec_at((void*)ram32);
}
else
{
sputs("\n\n");
sputs("Reading HEX-Record from UART..");
// Erase SDRAM
for (i=0; i < MAX_IMG_SIZE/4; i++)
ram32[i] = 0;
while(1)
{
sputs(".");
while(1)
{
result = srec_getline(buf);
srec_state = decode_srec(&srec, buf, result);
*pLED = 0;
switch (srec_state)
{
case srec_data:
if ((srec.addr + srec.size) > haddr)
haddr = srec.addr + srec.size;
pMem = (UINT8*)srec.addr;
for (i=0; i < srec.size; i++)
*pMem++ = srec.data[i];
break;
case srec_eob:
sputs("done\n\n");
img_hdr.magic = MAGIC_EB;
img_hdr.target_base = srec.addr;
img_hdr.img_size = haddr - srec.addr;
img_hdr.img_base = flash_offset + sizeof(flash_img_hdr_t);
img_hdr.hdr_next = flash_get_offset_blockaligned(&flash, img_hdr.img_base + img_hdr.img_size);
sputs("Size of application : ");print_word(img_hdr.img_size); sputs("\n");
sputs("Programming flash at : ");print_word(flash_offset); sputs("\n");
sputs("Next free flash offset : ");print_word(img_hdr.hdr_next); sputs("\n");
sputs("Flash erase...");
result = flash_erase(&flash, flash_offset, img_hdr.img_size + sizeof(flash_img_hdr_t));
if (IS_ERROR(result))
{
sputs("failed (");print_word(result);sputs(")\n");
break;
}
sputs("done\n");
sputs("Flash write...");
result = flash_program(&flash, flash_offset, (UINT8*)&img_hdr, sizeof(flash_img_hdr_t));
if (IS_ERROR(result))
{
sputs("failed (");print_word(result);sputs(")\n");
break;
}
result = flash_program(&flash, img_hdr.img_base, (UINT8*)img_hdr.target_base, img_hdr.img_size);
if (IS_ERROR(result))
{
sputs("failed (");print_word(result);sputs(")\n");
break;
}
sputs("done\n");
sputs("Flash verify...");
result = flash_verify(&flash, img_hdr.img_base, (UINT8*)img_hdr.target_base, img_hdr.img_size);
if (IS_ERROR(result))
{
sputs("failed (");print_word(result);sputs(")\n");
break;
}
sputs("passed\n");
// Jump to reset vector
Jump_to((void*)0xBFC00000);
break;
default:
result = -1;
break;
}
if (IS_ERROR(result))
{
*pLED = 0x40000000;
break;
}
};
}
}
return 0;
}

Some files were not shown because too many files have changed in this diff Show More