This is non-sense DPI-C example of SystemVerilog.
This example can run on Windows and ModelSim-Altera 10.1b.
C code is able to be compiled by Mingw-gcc.
to compile:
$ vlib work
| #include <stdio.h> | |
| #include <stdint.h> | |
| #include <inttypes.h> | |
| int main() { | |
| uint8_t u8 = UINT8_MAX; | |
| uint16_t u16 = UINT16_MAX; | |
| uint32_t u32 = UINT32_MAX; | |
| uint64_t u64 = UINT64_MAX; |
| #include <cstddef> | |
| #include <cstdint> | |
| #include <cassert> | |
| #include <iostream> | |
| template <std::size_t W> | |
| struct BV { | |
| std::uint32_t const value; | |
| explicit constexpr BV(std::uint32_t v) : value(v) { |
| module FF13_2_DialFacePuzzle where | |
| import Control.Monad (MonadPlus, msum) | |
| import Text.Printf (printf) | |
| import System.Environment (getArgs) | |
| import Debug.Trace (trace) | |
| type Graph = ([Int], [(Int, Int)]) | |
| -- |
| module Main where | |
| import Data.Char (chr) | |
| import System.Exit | |
| import Data.Word | |
| -- numbers | |
| num0 :: Int |
| {-# LANGUAGE TemplateHaskell #-} | |
| import Control.Lens | |
| data Hoge = A Int | |
| | B Bool | |
| | C Char | |
| | D | |
| | E String deriving Show |
This is non-sense DPI-C example of SystemVerilog.
This example can run on Windows and ModelSim-Altera 10.1b.
C code is able to be compiled by Mingw-gcc.
to compile:
$ vlib work
This is non-sense FFI example of Haskell.
to compile:
$ ghc --make eject.hs c_eject.c
can not choise drive, just run:
$ ./eject
This has some changes from original http://support.microsoft.com/kb/165721, to be compiled by cygwin-gcc.
to compile:
$ gcc -o eject eject.c
run with drive letter:
$ ./eject d
| #! /bin/bash | |
| IFS_BAK=$IFS | |
| IFS=':' | |
| is_include () { | |
| l=$1 | |
| e=$2 | |
| for p in $l; do | |
| if [ "$p" == "$e" ]; then |
| module BitVector (BitVector, unsigned, signed, width, value, toHexStr) where | |
| import Data.Bits | |
| import Data.Monoid | |
| import Text.Printf | |
| data BitVector = BV Int Integer | |
| width :: BitVector -> Int | |
| width (BV w _) = w |