├── .gitignore ├── CHANGES.md ├── KNOWN-BUGS.md ├── LICENSE ├── Makefile ├── README.md ├── VERSION ├── compiler ├── Makefile ├── _tags ├── absint.ml ├── arrays.ml ├── builtins.ml ├── cal.ml ├── caphc.ml ├── caphc.mllib ├── const.ml ├── dif.ml ├── diff │ ├── Makefile │ ├── location.ml.diff │ ├── location.ml.org │ ├── location.mli.diff │ ├── location.mli.org │ ├── log │ ├── parsing.ml.org │ ├── parsing.mli.org │ ├── parsing_m.ml.diff │ └── parsing_m.mli.diff ├── dot.ml ├── dsval.ml ├── dynamic.ml ├── error.ml ├── expr.ml ├── filepat.ml ├── foreign.ml ├── fsm.ml ├── genmake.ml ├── graph.ml ├── interm.ml ├── io.ml ├── itbl.ml ├── lexer.mll ├── location.ml ├── location.mli ├── logfile.ml ├── macro.ml ├── mangling.ml ├── misc.ml ├── moc.ml ├── options.ml ├── options_spec.txt ├── par_aux.ml ├── parser.mly ├── parsing_m.ml ├── parsing_m.mli ├── ports.ml ├── pr_type.ml ├── process.ml ├── sdf.ml ├── socket.ml ├── ssval.ml ├── static.ml ├── streams.ml ├── syntax.ml ├── systemc.ml ├── trace.ml ├── types.ml ├── typing.ml ├── varname.ml ├── vhdl.ml ├── vhdl_annot.ml └── xdf.ml ├── configure ├── dist ├── Readme ├── macos │ ├── INSTALL │ └── caph.ini ├── source │ ├── INSTALL │ └── Makefile └── windows │ ├── CaphSetup.iss │ ├── FIRST.TXT │ ├── icons │ ├── caph.bmp │ ├── caph.ico │ ├── caph_small.bmp │ ├── caphun.ico │ └── pofdigdfmcagihbc.png │ ├── setup_projects.cmd │ ├── windows-install-guide.pages │ ├── Data │ │ ├── examplesdir-small.jpg │ │ ├── examplesdir.jpg │ │ ├── finish-small.jpg │ │ ├── finish.jpg │ │ ├── installdir-small.jpg │ │ ├── installdir.jpg │ │ ├── installer.jpg │ │ ├── licence-small.jpg │ │ ├── licence.jpg │ │ ├── readytoinstall-small.jpg │ │ ├── readytoinstall.jpg │ │ ├── shortcut-small.jpg │ │ ├── shortcut.jpg │ │ ├── viewers-small.jpg │ │ └── viewers.jpg │ ├── Index.zip │ ├── Metadata │ │ ├── BuildVersionHistory.plist │ │ ├── DocumentIdentifier │ │ └── Properties.plist │ ├── preview-micro.jpg │ ├── preview-web.jpg │ └── preview.jpg │ └── windows-install-guide.pdf ├── doc ├── Makefile ├── Makefile.dist ├── lrm │ ├── Makefile │ ├── abssyn.tex │ ├── app_postfile.tex │ ├── bcprules.sty │ ├── bnf.sty │ ├── caph-lrm.bbl │ ├── caph-lrm.blg │ ├── caph-lrm.tex │ ├── doafter.sty │ ├── dynamic.tex │ ├── fifoif.tex │ ├── figs │ │ ├── act-class-ex.pdf │ │ ├── actornet.pdf │ │ ├── addinc.pdf │ │ ├── addinc2.pdf │ │ ├── biggernet.pdf │ │ ├── box-fsm.pdf │ │ ├── caph-icon.pdf │ │ ├── caph-logo.pdf │ │ ├── chain-ex.pdf │ │ ├── closednet.pdf │ │ ├── datarepr.pdf │ │ ├── datarepresentation.pdf │ │ ├── diamond.eps │ │ ├── diamond.pdf │ │ ├── diamonds.eps │ │ ├── diamonds.pdf │ │ ├── fifo-sizes-comp.pdf │ │ ├── fir1n-ex.pdf │ │ ├── foldl-ex1.pdf │ │ ├── foldt-ex.pdf │ │ ├── fouractors.pdf │ │ ├── grad-net.pdf │ │ ├── grad-net2.pdf │ │ ├── inc2f.pdf │ │ ├── languagestruct.pdf │ │ ├── lena128-grad.pdf │ │ ├── lena128.pdf │ │ ├── map-ex0.pdf │ │ ├── map-ex1.pdf │ │ ├── map-ex2.pdf │ │ ├── map-ex3.pdf │ │ ├── map2-ex1.pdf │ │ ├── mapi-ex1.pdf │ │ ├── mergeactor.pdf │ │ ├── napp-ex1.pdf │ │ ├── napp-ex2.pdf │ │ ├── nappi-ex1.pdf │ │ ├── networkfour.pdf │ │ ├── pipe-ex.pdf │ │ ├── rec1.pdf │ │ ├── rec2.pdf │ │ ├── sample-act-fsm.pdf │ │ ├── sample2-act.pdf │ │ ├── sample4-act.pdf │ │ ├── sdf-fifosizes-ex.pdf │ │ ├── select-dpn.pdf │ │ ├── smallnet.pdf │ │ ├── smallnet1.pdf │ │ ├── smallnet2.pdf │ │ ├── suml-act-fsm.pdf │ │ ├── suml-fsm.pdf │ │ ├── suml-rec.pdf │ │ ├── switch-act-fsm.pdf │ │ ├── switch-ex.pdf │ │ ├── toolset.pdf │ │ ├── twice.pdf │ │ └── types.pdf │ ├── foreign.tex │ ├── interm.tex │ ├── introduction.tex │ ├── moc.tex │ ├── options.tex │ ├── overview.tex │ ├── prelude.tex │ ├── semabbrev.sty │ ├── spverbatim.sty │ ├── static.tex │ ├── syntax.sty │ ├── syntax.tex │ ├── typing.tex │ ├── using.tex │ └── variants.tex └── primer │ ├── Makefile │ ├── biblio.bbl │ ├── caph-primer.tex │ ├── cl-basic.tex │ ├── cl-images.tex │ ├── cl-intro.tex │ ├── cl-ip.tex │ ├── figs │ ├── caph-logo.pdf │ ├── cconv.pdf │ ├── conv-a.pdf │ ├── conv-b.pdf │ ├── dx_act.pdf │ ├── dy_act.pdf │ ├── grad-dot.pdf │ ├── ide │ │ ├── config.pdf │ │ ├── create-project.pdf │ │ ├── first-program.pdf │ │ ├── main-window-empty.pdf │ │ ├── main-window.pdf │ │ ├── make-dot.pdf │ │ ├── make-sim.pdf │ │ ├── make-systemc.pdf │ │ ├── make-vhdl.pdf │ │ ├── opened-project.pdf │ │ ├── opening-project.pdf │ │ ├── options-sysc.pdf │ │ ├── options.pdf │ │ ├── project-main-done.pdf │ │ ├── project-main.pdf │ │ ├── project-make.pdf │ │ └── write-sample.pdf │ ├── img4.pdf │ ├── inv-dot.pdf │ ├── inv-result.pdf │ ├── lena128.pdf │ ├── networkfour.pdf │ ├── pcb-res.pdf │ ├── pcb.pdf │ ├── simple-dot.pdf │ ├── simple-quartus-1.pdf │ ├── simple-quartus-2.pdf │ ├── simple-quartus-3.pdf │ ├── simple-quartus-4.pdf │ ├── simple-quartus-5.pdf │ ├── simple-quartus-6.pdf │ ├── simple-quartus-7.pdf │ ├── simple-waves.pdf │ ├── sobel-dot.pdf │ ├── sobel-full.pdf │ ├── sobel-quartus-1.pdf │ ├── sobel-quartus-2.pdf │ ├── sobel-quartus-3.pdf │ └── toolset.pdf │ ├── ide-basic.tex │ ├── ide-intro.tex │ ├── ide-options.tex │ ├── ide-project.tex │ ├── intro.tex │ ├── lang-basic.tex │ ├── lang-images.tex │ ├── lang-intro.tex │ └── lang-ip.tex ├── etc ├── Makefile ├── do_test ├── mk_caphy_proj └── searchpath ├── examples ├── Makefile ├── build_dir ├── do_test ├── imgs │ ├── feep.pgm │ ├── lena128.pgm │ ├── lena256.pgm │ ├── lena64.pgm │ └── pcb.pgm └── working │ ├── Compute_mocs │ ├── Makefile │ ├── Readme │ ├── apps │ ├── binimg │ │ ├── lena64.pgm │ │ ├── main.cph │ │ ├── main.procs │ │ └── main.proj │ ├── blob │ │ ├── main.cph │ │ ├── main.proj │ │ ├── sample.pgm │ │ └── sample.txt │ ├── dx_v1 │ │ ├── main.cph │ │ ├── main.proj │ │ └── sample.txt │ ├── dx_v2 │ │ ├── main.cph │ │ ├── main.proj │ │ └── sample.txt │ ├── dy │ │ ├── img0.txt │ │ ├── img1.txt │ │ ├── img2.txt │ │ ├── img3.txt │ │ ├── main.cph │ │ ├── main.proj │ │ └── sample.txt │ ├── grad │ │ ├── lena64.pgm │ │ ├── main.cph │ │ ├── main.procs │ │ └── main.proj │ ├── histo │ │ ├── main.cph │ │ ├── main.proj │ │ ├── main_tb.sav │ │ └── sample.txt │ ├── histo2d │ │ ├── main.cph │ │ ├── main.proj │ │ └── sample.txt │ ├── histof │ │ ├── main.cph │ │ ├── main.proj │ │ └── sample.txt │ ├── histol │ │ ├── main.cph │ │ ├── main.proj │ │ ├── main_tb.sav │ │ └── sample.txt │ ├── hproj │ │ ├── img.pgm │ │ ├── img.txt │ │ ├── main.cph │ │ └── main.proj │ ├── median13 │ │ ├── main.cph │ │ ├── main.proj │ │ └── sample.txt │ ├── rl │ │ ├── main.cph │ │ ├── main.proj │ │ ├── rl_type.cph │ │ └── sample.txt │ ├── rld │ │ ├── main.cph │ │ ├── main.proj │ │ ├── rl_type.cph │ │ ├── rld.cph │ │ └── sample.txt │ ├── rle │ │ ├── main.cph │ │ ├── main.proj │ │ ├── rl_type.cph │ │ ├── rle.cph │ │ └── sample.txt │ ├── transpose │ │ ├── main.cph │ │ ├── main.proj │ │ ├── main_tb.sav │ │ └── sample.txt │ └── vproj │ │ ├── main.cph │ │ ├── main.proj │ │ ├── sample.pgm │ │ └── sample.txt │ ├── basic │ ├── bitop │ │ ├── main.cph │ │ ├── main.proj │ │ └── sample.txt │ ├── cmp │ │ ├── main.cph │ │ ├── main.proj │ │ └── sample.txt │ ├── cmps │ │ ├── main.cph │ │ ├── main.proj │ │ └── sample.txt │ ├── globals │ │ ├── main.cph │ │ ├── main.proj │ │ └── sample.txt │ ├── let │ │ ├── main.cph │ │ ├── main.proj │ │ └── sample.txt │ ├── lut1 │ │ ├── main.cph │ │ ├── main.proj │ │ └── sample.txt │ ├── lut2 │ │ ├── main.cph │ │ ├── main.proj │ │ └── sample.txt │ ├── lut3 │ │ ├── main.cph │ │ ├── main.proj │ │ └── sample.txt │ ├── lut4 │ │ ├── main.cph │ │ ├── main.proj │ │ └── sample.txt │ ├── mux │ │ ├── main.cph │ │ ├── main.proj │ │ ├── sample1.txt │ │ ├── sample2.txt │ │ └── sample3.txt │ ├── scale │ │ ├── main.cph │ │ ├── main.proj │ │ └── sample.txt │ ├── scale2 │ │ ├── main.cph │ │ ├── main.proj │ │ └── sample.txt │ ├── simple │ │ ├── Readme │ │ ├── main.cph │ │ ├── main.proj │ │ └── sample.txt │ ├── thr1 │ │ ├── main.cph │ │ ├── main.proj │ │ └── sample.txt │ └── thr2 │ │ ├── main.cph │ │ ├── main.proj │ │ └── sample.txt │ ├── cal │ └── suml │ │ ├── main.cph │ │ ├── main.proj │ │ ├── main_tb.sav │ │ └── sample.txt │ ├── conv │ ├── conv13_v1 │ │ ├── main.cph │ │ ├── main.proj │ │ ├── sample1.txt │ │ └── sample2.txt │ ├── conv13_v2 │ │ ├── main.cph │ │ ├── main.proj │ │ ├── sample1.txt │ │ └── sample2.txt │ ├── conv33_v1 │ │ ├── lena64.pgm │ │ ├── main.cph │ │ ├── main.procs │ │ ├── main.proj │ │ └── sample.txt │ ├── conv33_v2 │ │ ├── lena128.pgm │ │ ├── lena128.txt │ │ ├── lena64.pgm │ │ ├── main.cph │ │ ├── main.procs │ │ └── main.proj │ ├── conv33_v3 │ │ ├── lena128.pgm │ │ ├── main.cph │ │ ├── main.procs │ │ ├── main.proj │ │ └── main.rules │ ├── conv_bank │ │ ├── lena64.pgm │ │ ├── lena64.txt │ │ ├── main.cph │ │ └── main.proj │ ├── mkconv1 │ │ ├── lena128.pgm │ │ ├── main.cph │ │ ├── main.procs │ │ ├── main.proj │ │ └── main.rules │ └── mkconv2 │ │ ├── lena128.pgm │ │ ├── main.cph │ │ ├── main.procs │ │ └── main.proj │ ├── dpn │ ├── ex1-4 │ │ ├── main.cph │ │ ├── main.proj │ │ └── sample.txt │ ├── ex1-8 │ │ ├── main.cph │ │ ├── main.proj │ │ └── sample.txt │ └── ex3-5 │ │ ├── main.cph │ │ ├── main.proj │ │ └── sample.txt │ ├── fir │ ├── fir12 │ │ ├── main.cph │ │ ├── main.proj │ │ └── sample.txt │ ├── fir13 │ │ ├── main.cph │ │ ├── main.proj │ │ ├── main_tb.sav │ │ └── sample.txt │ ├── fir1n │ │ ├── main.cph │ │ ├── main.proj │ │ └── sample.txt │ ├── fir22 │ │ ├── main.cph │ │ ├── main.proj │ │ └── sample.txt │ └── fir33sep │ │ ├── main.cph │ │ ├── main.proj │ │ ├── misc.cph │ │ ├── sample.txt │ │ ├── xfir13_mono.cph │ │ ├── xfir13_multi.cph │ │ ├── xfir31_mono.cph │ │ └── xfir31_multi.cph │ ├── float │ ├── fscale │ │ ├── main.cph │ │ ├── main.proj │ │ └── sample.txt │ └── heron │ │ ├── main.cph │ │ ├── main.proj │ │ └── sample.txt │ ├── ho │ ├── binimg │ │ ├── lena64.pgm │ │ ├── lena64.txt │ │ ├── main.cph │ │ └── main.proj │ ├── fmap │ │ ├── main.cph │ │ ├── main.proj │ │ ├── sample1.txt │ │ └── sample2.txt │ ├── foldn │ │ ├── main.cph │ │ ├── main.proj │ │ ├── sample1.txt │ │ └── sample2.txt │ ├── grad │ │ ├── lena128.pgm │ │ ├── lena128.txt │ │ ├── lena64.pgm │ │ ├── lena64.txt │ │ ├── main.cph │ │ └── main.proj │ ├── sfold │ │ ├── main.cph │ │ ├── main.proj │ │ ├── sample1.txt │ │ └── sample2.txt │ ├── smap │ │ ├── main.cph │ │ ├── main.proj │ │ ├── sample1.txt │ │ └── sample2.txt │ ├── smap2 │ │ ├── main.cph │ │ ├── main.proj │ │ ├── sample11.txt │ │ └── sample12.txt │ └── ssfold │ │ ├── img.pgm │ │ ├── img.txt │ │ ├── main.cph │ │ └── main.proj │ ├── io │ ├── fglob1 │ │ ├── Readme │ │ ├── main.cph │ │ ├── main.proj │ │ ├── main.rules │ │ ├── sample_1.txt │ │ └── sample_2.txt │ ├── fglob2 │ │ ├── Readme │ │ ├── im-1.pgm │ │ ├── im-2.pgm │ │ ├── im-3.pgm │ │ ├── im-4.pgm │ │ ├── main.cph │ │ └── main.proj │ └── portio │ │ ├── Readme │ │ ├── factors.txt │ │ ├── main.cph │ │ ├── main.proj │ │ ├── main.rules │ │ ├── main_tb.sav │ │ └── sample.txt │ ├── misc │ ├── bigfifo │ │ ├── lena64.pgm │ │ ├── main.cph │ │ ├── main.procs │ │ └── main.proj │ ├── ccond │ │ ├── main.cph │ │ ├── main.proj │ │ └── sample.txt │ ├── fact │ │ ├── main.cph │ │ ├── main.proj │ │ └── sample.txt │ ├── factrec │ │ ├── main.cph │ │ ├── main.proj │ │ └── sample.txt │ ├── foreign │ │ ├── extra │ │ │ ├── extfns.cpp │ │ │ ├── extfns.h │ │ │ ├── extfns.ml │ │ │ └── extfns.vhd │ │ ├── main.cph │ │ ├── main.proj │ │ └── sample.txt │ ├── implemented │ │ ├── extra │ │ │ └── my_div.vhd │ │ ├── main.cph │ │ ├── main.proj │ │ ├── main_tb.sav │ │ ├── sample1.txt │ │ └── sample2.txt │ ├── ioless │ │ ├── main.cph │ │ └── main.proj │ ├── ioless2 │ │ ├── extra │ │ │ ├── read_data.cpp │ │ │ ├── read_data.h │ │ │ ├── write_result.cpp │ │ │ └── write_result.h │ │ ├── main.cph │ │ └── main.proj │ ├── macro │ │ ├── main.cph │ │ ├── main.proj │ │ └── sample.txt │ ├── mhume │ │ ├── main.cph │ │ ├── main.proj │ │ └── sample.txt │ ├── sample │ │ ├── main.cph │ │ ├── main.proj │ │ └── sample.txt │ ├── suml │ │ ├── main.cph │ │ ├── main.proj │ │ ├── main_tb.sav │ │ └── sample.txt │ ├── sumlrec │ │ ├── main.cph │ │ ├── main.proj │ │ └── sample.txt │ ├── sumn │ │ ├── main.cph │ │ ├── main.proj │ │ └── sample.txt │ └── thrd │ │ ├── main.cph │ │ ├── main.proj │ │ ├── sample1.txt │ │ └── sample2.txt │ ├── moc │ ├── mocs │ │ ├── main.cph │ │ ├── main.proj │ │ ├── sample.txt │ │ ├── sample1.txt │ │ └── sample2.txt │ └── sdfsz │ │ ├── main.cph │ │ ├── main.proj │ │ └── sample.txt │ ├── network │ ├── chain │ │ ├── main.cph │ │ ├── main.proj │ │ └── sample.txt │ ├── compose1 │ │ ├── main.cph │ │ ├── main.proj │ │ └── sample.txt │ ├── compose2 │ │ ├── main.cph │ │ ├── main.proj │ │ └── sample.txt │ ├── cond │ │ ├── main.cph │ │ ├── main.proj │ │ ├── main_tb.sav │ │ └── sample.txt │ ├── diamond │ │ ├── main.cph │ │ ├── main.proj │ │ └── sample.txt │ ├── diamonds │ │ ├── main.cph │ │ ├── main.proj │ │ └── sample.txt │ ├── filter_bank │ │ ├── main.cph │ │ ├── main.proj │ │ └── sample.txt │ ├── foldl │ │ ├── main.cph │ │ ├── main.proj │ │ └── sample.txt │ ├── foldli │ │ ├── main.cph │ │ ├── main.proj │ │ └── sample.txt │ ├── foldmap │ │ ├── main.cph │ │ ├── main.proj │ │ ├── main.rules │ │ ├── sample.txt │ │ └── z.txt │ ├── foldt │ │ ├── main.cph │ │ ├── main.proj │ │ └── sample.txt │ ├── map2 │ │ ├── main.cph │ │ ├── main.proj │ │ └── sample.txt │ ├── map2i │ │ ├── main.cph │ │ ├── main.proj │ │ └── sample.txt │ ├── map_1 │ │ ├── main.cph │ │ ├── main.proj │ │ └── sample.txt │ ├── map_2 │ │ ├── main.cph │ │ ├── main.proj │ │ └── sample.txt │ ├── map_3 │ │ ├── main.cph │ │ ├── main.proj │ │ └── sample.txt │ ├── mapi │ │ ├── main.cph │ │ ├── main.proj │ │ └── sample.txt │ ├── msfl33 │ │ ├── main.cph │ │ ├── main.proj │ │ └── sample.txt │ ├── mutrec │ │ ├── main.cph │ │ ├── main.proj │ │ ├── sample1.txt │ │ └── sample2.txt │ ├── napp1 │ │ ├── main.cph │ │ ├── main.proj │ │ └── sample.txt │ ├── napp2 │ │ ├── main.cph │ │ ├── main.proj │ │ └── sample.txt │ ├── nappi │ │ ├── main.cph │ │ ├── main.proj │ │ └── sample.txt │ ├── pipe │ │ ├── main.cph │ │ ├── main.proj │ │ └── sample.txt │ ├── scm │ │ ├── main.cph │ │ ├── main.proj │ │ └── sample.txt │ ├── scm2 │ │ ├── main.cph │ │ ├── main.proj │ │ └── sample.txt │ └── while │ │ ├── main.cph │ │ ├── main.proj │ │ └── sample.txt │ ├── primer │ ├── invimg │ │ ├── lena128.pgm │ │ ├── main.cph │ │ ├── main.procs │ │ └── main.proj │ ├── simple │ │ ├── main.cph │ │ ├── main.proj │ │ ├── sample.txt │ │ └── simple_tb.sav │ ├── sobel │ │ ├── main.cph │ │ ├── main.procs │ │ ├── main.proj │ │ └── pcb.pgm │ └── sobel2 │ │ ├── main.cph │ │ ├── main.procs │ │ ├── main.proj │ │ ├── main.rules │ │ └── pcb.pgm │ └── typing │ ├── generics1 │ ├── main.cph │ ├── main.proj │ └── sample.txt │ ├── generics2 │ ├── main.cph │ ├── main.proj │ ├── sample1.txt │ └── sample2.txt │ ├── gensz │ ├── main.cph │ ├── main.proj │ ├── sample1.txt │ └── sample2.txt │ ├── gfmux │ ├── main.cph │ ├── main.proj │ ├── sample1.txt │ ├── sample11.txt │ ├── sample12.txt │ ├── sample2.txt │ ├── sample21.txt │ ├── sample22.txt │ └── sample3.txt │ ├── mixedarithm1 │ ├── main.cph │ ├── main.proj │ ├── sample1.txt │ └── sample2.txt │ ├── mixedarithm2 │ ├── main.cph │ ├── main.proj │ ├── sample1.txt │ ├── sample11.txt │ ├── sample12.txt │ ├── sample2.txt │ ├── sample21.txt │ └── sample22.txt │ ├── mixedarithm3 │ ├── main.cph │ ├── main.proj │ ├── sample11.txt │ └── sample12.txt │ ├── option │ ├── main.cph │ ├── main.proj │ └── sample1.txt │ ├── ovfl │ ├── main.cph │ ├── main.proj │ └── sample.txt │ ├── resize │ ├── main.cph │ ├── main.proj │ ├── sample1.txt │ └── sample2.txt │ ├── tydecl1 │ ├── main.cph │ ├── main.proj │ ├── sample1.txt │ └── sample2.txt │ └── tydecl2 │ ├── main.cph │ ├── main.proj │ ├── sample1.txt │ └── sample2.txt ├── gui ├── Info.plist ├── Readme ├── app_file.h ├── caph.pro ├── command.cpp ├── command.h ├── config.cpp ├── config.h ├── img │ ├── closefile.png │ ├── closeproject.png │ ├── coller.png │ ├── color.png │ ├── compile.png │ ├── compileSystemC.png │ ├── compileVHDL.png │ ├── compileXDF.png │ ├── compilegraph.png │ ├── copier.png │ ├── couper.png │ ├── exit.png │ ├── icon.graffle │ ├── icon.png │ ├── new.png │ ├── open.png │ ├── preferences.png │ ├── preferencescompil.png │ ├── save.png │ ├── saveall.png │ ├── select_all.png │ └── simu.png ├── main.cpp ├── mainwindow.cpp ├── mainwindow.h ├── optdesc │ └── options_spec.txt ├── option.cpp ├── option.h ├── options.cpp ├── options.h ├── project.cpp ├── project.h ├── project_window.cpp ├── project_window.h ├── resources.qrc ├── syntax_highlighter.cpp ├── syntax_highlighter.h └── uis │ ├── config.ui │ ├── mainwindow.ui │ └── projet.ui ├── lib ├── Makefile ├── c │ ├── Makefile │ ├── README │ ├── tyconv.c │ └── tyconv.h ├── caph │ ├── Makefile │ ├── README │ ├── convol.cph │ ├── dc.cph │ ├── img_ops.cph │ ├── imgops.cph │ ├── list_ops.cph │ ├── listops.cph │ ├── neigh.cph │ ├── stream_ops.cph │ └── streamops.cph ├── etc │ ├── Makefile │ └── Makefile.core ├── systemc │ ├── Makefile │ ├── README │ ├── array_io.h │ ├── buffer_in.h │ ├── buffer_out.h │ ├── fifo.h │ ├── fifo_ifs.h │ ├── io_event.h │ ├── port_in.h │ ├── port_out.h │ ├── sc_int_io.h │ ├── split.h │ ├── stream_dc_in.h │ ├── stream_dc_out.h │ ├── stream_in.h │ ├── stream_out.h │ └── variants.h └── vhdl │ ├── Makefile │ ├── README │ ├── caph.vhd │ ├── caph_fp.vhd │ ├── cstream_in.vhd │ ├── cstream_out.vhd │ ├── data_types.vhd │ ├── fifo.vhd │ ├── port_buffer.vhd │ ├── port_in.vhd │ ├── port_out.vhd │ ├── stream_in.vhd │ ├── stream_in_mult.vhd │ ├── stream_out.vhd │ └── stream_out_mult.vhd ├── man ├── Makefile ├── Makefile.dist ├── bin2pgm.pod ├── bin2txt.pod ├── caphmake.pod ├── mkconv.pod ├── mkdcimg.pod ├── pgm2bin.pod ├── pgm2txt.pod ├── txt2bin.pod └── txt2pgm.pod └── tools ├── Makefile ├── README ├── _tags ├── bin2pgm.c ├── bin2txt.c ├── caphmake.ml ├── compiler ├── dc.c ├── dc.h ├── fmt.c ├── fmt.h ├── mkconv.ml ├── mkdcimg.c ├── mkproject.ml ├── pgm2bin.c ├── pgm2txt.c ├── txt2bin.c └── txt2pgm.c /LICENSE: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jserot/caph/2b3b241f0c32aa4fcaf60d4b8529956cca8aa6b1/LICENSE -------------------------------------------------------------------------------- /VERSION: -------------------------------------------------------------------------------- 1 | VERSION=2.9.1beta 2 | -------------------------------------------------------------------------------- /compiler/_tags: -------------------------------------------------------------------------------- 1 | true: annot, explain, debug 2 | : syntax(camlp4o), package(camlp4.macro) 3 | : syntax(camlp4o), package(camlp4.macro) 4 | : use_unix, use_str, use_dynlink 5 | -------------------------------------------------------------------------------- /compiler/caphc.mllib: -------------------------------------------------------------------------------- 1 | Parsing_m Version Misc Filepat Location Lexer Parser Const Itbl Types Varname Pr_type Error Typing Genmake Logfile Macro Syntax Mangling Arrays Foreign Expr Ssval Dsval Interm Static Dynamic Process Trace Ports Io Streams Dot Vhdl Vhdl_annot Systemc Options Options_spec Builtins Absint Xdf 2 | -------------------------------------------------------------------------------- /compiler/diff/Makefile: -------------------------------------------------------------------------------- 1 | DIFF=diff #-Nau 2 | 3 | all: diff 4 | 5 | diff: #FORCE 6 | echo "Hello" 7 | /usr/bin/diff location.mli.org ../location.mli > location.mli.diff 8 | # $(DIFF) location.ml.org ../location.ml > location.ml.diff 9 | # $(DIFF) parsing.mli.org ../parsing_m.mli > parsing_m.mli.diff 10 | # $(DIFF) parsing.ml.org ../parsing_m.ml > parsing_m.ml.diff 11 | 12 | clean: 13 | 14 | realclean: clean 15 | rm -f *.diff 16 | rm -f *~ 17 | 18 | clobber: realclean 19 | 20 | #FORCE: 21 | -------------------------------------------------------------------------------- /compiler/diff/location.mli.org: -------------------------------------------------------------------------------- 1 | type location = 2 | Loc of int (* Position of the first character *) 3 | * int (* Position of the next character following the last one *) 4 | ;; 5 | 6 | value get_current_location : unit -> location 7 | and no_location : location 8 | and input_name : string ref 9 | and input_chan : in_channel ref 10 | and input_lexbuf : lexing__lexbuf ref 11 | ;; 12 | 13 | value output_location: out_channel -> location -> unit 14 | and output_input_name: out_channel -> unit 15 | ;; 16 | -------------------------------------------------------------------------------- /compiler/diff/parsing_m.ml.diff: -------------------------------------------------------------------------------- 1 | 14c14,16 2 | < (* $Id: parsing.ml 9163 2009-01-13 15:17:51Z doligez $ *) 3 | --- 4 | > (* $Id: parsing.ml 9270 2009-05-20 11:52:42Z doligez $ *) 5 | > 6 | > (* Modified 2014-11-03 by jserot (jocelyn.serot@univ-bpclermont.fr) to support dynamic lexing buffers *) 7 | 129,131c131,133 8 | < let t = Obj.repr(lexer lexbuf) in 9 | < env.symb_start <- lexbuf.lex_start_p; 10 | < env.symb_end <- lexbuf.lex_curr_p; 11 | --- 12 | > let t = Obj.repr(lexer !lexbuf) in 13 | > env.symb_start <- !lexbuf.lex_start_p; 14 | > env.symb_end <- !lexbuf.lex_curr_p; 15 | 157c159 16 | < env.symb_end <- lexbuf.lex_curr_p; 17 | --- 18 | > env.symb_end <- !lexbuf.lex_curr_p; 19 | -------------------------------------------------------------------------------- /compiler/diff/parsing_m.mli.diff: -------------------------------------------------------------------------------- 1 | 14c14,16 2 | < (* $Id: parsing.mli 8983 2008-08-06 09:38:25Z xleroy $ *) 3 | --- 4 | > (* $Id: parsing.mli 10457 2010-05-21 18:30:12Z doligez $ *) 5 | > 6 | > (* Modified 2014-11-03 by jserot (jocelyn.serot@univ-bpclermont.fr) to support dynamic lexing buffers *) 7 | 68c70,72 8 | < The boolean returned is the previous state of the trace flag. *) 9 | --- 10 | > The boolean returned is the previous state of the trace flag. 11 | > @since 3.11.0 12 | > *) 13 | 99,100c103 14 | < val yyparse : 15 | < parse_tables -> int -> (Lexing.lexbuf -> 'a) -> Lexing.lexbuf -> 'b 16 | --- 17 | > val yyparse : parse_tables -> int -> (Lexing.lexbuf -> 'a) -> Lexing.lexbuf ref -> 'b 18 | -------------------------------------------------------------------------------- /dist/Readme: -------------------------------------------------------------------------------- 1 | Platform-specific files 2 | -------------------------------------------------------------------------------- /dist/macos/INSTALL: -------------------------------------------------------------------------------- 1 | 1. Drag [Caph.app] to the [Applications] folder 2 | 2. Drag the [Documentation] and [Examples] folders anywhere on your computer 3 | 3. Launch [Caph] by double-clicking on it in the [Applications] folder 4 | -------------------------------------------------------------------------------- /dist/macos/caph.ini: -------------------------------------------------------------------------------- 1 | CAPHC=/Applications/Caph.app/Contents/MacOS/caphc 2 | CAPHLIB=/Applications/Caph.app/Contents/Resources/lib 3 | DOTVIEWER=open -a Graphviz 4 | PGMVIEWER=open -a Toyviewer 5 | -------------------------------------------------------------------------------- /dist/windows/FIRST.TXT: -------------------------------------------------------------------------------- 1 | 1. Launch CAPH (go to the installation directory and click the application icon or use the Task Bar) 2 | 2. Open an example project (File menu > Open Project or Ctl-P, then select the .cphpro file in the project directory) 3 | 3. To view the dataflow graph hit the "Graph" button 4 | 3. To simulate the design hit the "Simu" button 5 | 4. To generate the SystemC code hit the "SystemC" button 6 | 5. To generate the VHDL code hit the "VHDL" button 7 | 6. The generated code is written in the "systemc" (resp. "vhdl") sub-directory 8 | -------------------------------------------------------------------------------- /dist/windows/icons/caph.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jserot/caph/2b3b241f0c32aa4fcaf60d4b8529956cca8aa6b1/dist/windows/icons/caph.bmp -------------------------------------------------------------------------------- /dist/windows/icons/caph.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jserot/caph/2b3b241f0c32aa4fcaf60d4b8529956cca8aa6b1/dist/windows/icons/caph.ico -------------------------------------------------------------------------------- /dist/windows/icons/caph_small.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jserot/caph/2b3b241f0c32aa4fcaf60d4b8529956cca8aa6b1/dist/windows/icons/caph_small.bmp -------------------------------------------------------------------------------- /dist/windows/icons/caphun.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jserot/caph/2b3b241f0c32aa4fcaf60d4b8529956cca8aa6b1/dist/windows/icons/caphun.ico -------------------------------------------------------------------------------- /dist/windows/icons/pofdigdfmcagihbc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jserot/caph/2b3b241f0c32aa4fcaf60d4b8529956cca8aa6b1/dist/windows/icons/pofdigdfmcagihbc.png -------------------------------------------------------------------------------- /dist/windows/setup_projects.cmd: -------------------------------------------------------------------------------- 1 | rem Usage : setup_projects 2 | @echo off 3 | echo "Updating projects" 4 | cd %2 5 | for /d /r %%i in (*) do ( 6 | echo %%i 7 | cd %%i 8 | %1\bin\mkproject -platform win32 -caph %1 -dotviewer %3 -pgmviewer %4 %%~ni.proj 9 | cd ..\..\.. 10 | ) 11 | echo. 12 | -------------------------------------------------------------------------------- /dist/windows/windows-install-guide.pages/Data/examplesdir-small.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jserot/caph/2b3b241f0c32aa4fcaf60d4b8529956cca8aa6b1/dist/windows/windows-install-guide.pages/Data/examplesdir-small.jpg -------------------------------------------------------------------------------- /dist/windows/windows-install-guide.pages/Data/examplesdir.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jserot/caph/2b3b241f0c32aa4fcaf60d4b8529956cca8aa6b1/dist/windows/windows-install-guide.pages/Data/examplesdir.jpg -------------------------------------------------------------------------------- /dist/windows/windows-install-guide.pages/Data/finish-small.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jserot/caph/2b3b241f0c32aa4fcaf60d4b8529956cca8aa6b1/dist/windows/windows-install-guide.pages/Data/finish-small.jpg -------------------------------------------------------------------------------- /dist/windows/windows-install-guide.pages/Data/finish.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jserot/caph/2b3b241f0c32aa4fcaf60d4b8529956cca8aa6b1/dist/windows/windows-install-guide.pages/Data/finish.jpg -------------------------------------------------------------------------------- /dist/windows/windows-install-guide.pages/Data/installdir-small.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jserot/caph/2b3b241f0c32aa4fcaf60d4b8529956cca8aa6b1/dist/windows/windows-install-guide.pages/Data/installdir-small.jpg -------------------------------------------------------------------------------- /dist/windows/windows-install-guide.pages/Data/installdir.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jserot/caph/2b3b241f0c32aa4fcaf60d4b8529956cca8aa6b1/dist/windows/windows-install-guide.pages/Data/installdir.jpg -------------------------------------------------------------------------------- /dist/windows/windows-install-guide.pages/Data/installer.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jserot/caph/2b3b241f0c32aa4fcaf60d4b8529956cca8aa6b1/dist/windows/windows-install-guide.pages/Data/installer.jpg -------------------------------------------------------------------------------- /dist/windows/windows-install-guide.pages/Data/licence-small.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jserot/caph/2b3b241f0c32aa4fcaf60d4b8529956cca8aa6b1/dist/windows/windows-install-guide.pages/Data/licence-small.jpg -------------------------------------------------------------------------------- /dist/windows/windows-install-guide.pages/Data/licence.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jserot/caph/2b3b241f0c32aa4fcaf60d4b8529956cca8aa6b1/dist/windows/windows-install-guide.pages/Data/licence.jpg -------------------------------------------------------------------------------- /dist/windows/windows-install-guide.pages/Data/readytoinstall-small.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jserot/caph/2b3b241f0c32aa4fcaf60d4b8529956cca8aa6b1/dist/windows/windows-install-guide.pages/Data/readytoinstall-small.jpg -------------------------------------------------------------------------------- /dist/windows/windows-install-guide.pages/Data/readytoinstall.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jserot/caph/2b3b241f0c32aa4fcaf60d4b8529956cca8aa6b1/dist/windows/windows-install-guide.pages/Data/readytoinstall.jpg -------------------------------------------------------------------------------- /dist/windows/windows-install-guide.pages/Data/shortcut-small.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jserot/caph/2b3b241f0c32aa4fcaf60d4b8529956cca8aa6b1/dist/windows/windows-install-guide.pages/Data/shortcut-small.jpg -------------------------------------------------------------------------------- /dist/windows/windows-install-guide.pages/Data/shortcut.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jserot/caph/2b3b241f0c32aa4fcaf60d4b8529956cca8aa6b1/dist/windows/windows-install-guide.pages/Data/shortcut.jpg -------------------------------------------------------------------------------- /dist/windows/windows-install-guide.pages/Data/viewers-small.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jserot/caph/2b3b241f0c32aa4fcaf60d4b8529956cca8aa6b1/dist/windows/windows-install-guide.pages/Data/viewers-small.jpg -------------------------------------------------------------------------------- /dist/windows/windows-install-guide.pages/Data/viewers.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jserot/caph/2b3b241f0c32aa4fcaf60d4b8529956cca8aa6b1/dist/windows/windows-install-guide.pages/Data/viewers.jpg -------------------------------------------------------------------------------- /dist/windows/windows-install-guide.pages/Index.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jserot/caph/2b3b241f0c32aa4fcaf60d4b8529956cca8aa6b1/dist/windows/windows-install-guide.pages/Index.zip -------------------------------------------------------------------------------- /dist/windows/windows-install-guide.pages/Metadata/BuildVersionHistory.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | pages-trunk-20080703_5 6 | pages-trunk-20080707_3 7 | pages-trunk-20080904_1 8 | 5B54 9 | M5.0-1465-1 10 | 11 | 12 | -------------------------------------------------------------------------------- /dist/windows/windows-install-guide.pages/Metadata/DocumentIdentifier: -------------------------------------------------------------------------------- 1 | 02140BE4-48AA-4BE0-9230-4C0401833335 -------------------------------------------------------------------------------- /dist/windows/windows-install-guide.pages/Metadata/Properties.plist: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jserot/caph/2b3b241f0c32aa4fcaf60d4b8529956cca8aa6b1/dist/windows/windows-install-guide.pages/Metadata/Properties.plist -------------------------------------------------------------------------------- /dist/windows/windows-install-guide.pages/preview-micro.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jserot/caph/2b3b241f0c32aa4fcaf60d4b8529956cca8aa6b1/dist/windows/windows-install-guide.pages/preview-micro.jpg -------------------------------------------------------------------------------- /dist/windows/windows-install-guide.pages/preview-web.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jserot/caph/2b3b241f0c32aa4fcaf60d4b8529956cca8aa6b1/dist/windows/windows-install-guide.pages/preview-web.jpg -------------------------------------------------------------------------------- /dist/windows/windows-install-guide.pages/preview.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jserot/caph/2b3b241f0c32aa4fcaf60d4b8529956cca8aa6b1/dist/windows/windows-install-guide.pages/preview.jpg -------------------------------------------------------------------------------- /dist/windows/windows-install-guide.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jserot/caph/2b3b241f0c32aa4fcaf60d4b8529956cca8aa6b1/dist/windows/windows-install-guide.pdf -------------------------------------------------------------------------------- /doc/Makefile: -------------------------------------------------------------------------------- 1 | include ../config 2 | 3 | all: 4 | (cd lrm; $(MAKE) all) 5 | (cd primer; $(MAKE) all) 6 | 7 | install: 8 | (cd lrm; $(MAKE) install) 9 | (cd primer; $(MAKE) install) 10 | 11 | clean: 12 | (cd lrm; $(MAKE) clean) 13 | (cd primer; $(MAKE) clean) 14 | if [ -d examples ]; then (cd examples; $(MAKE) clean) fi 15 | 16 | clobber: 17 | (cd lrm; $(MAKE) clobber) 18 | (cd primer; $(MAKE) clobber) 19 | if [ -d examples ]; then (cd examples; $(MAKE) clobber) fi 20 | 21 | realclean: clobber 22 | -------------------------------------------------------------------------------- /doc/Makefile.dist: -------------------------------------------------------------------------------- 1 | include ../config 2 | 3 | all: 4 | @echo "Nothing to do" 5 | 6 | install: 7 | $(INSTALL) -d $(DOCDIR) 8 | (for f in *.pdf; do $(CP) $$f $(DOCDIR); done) 9 | 10 | clean: 11 | @echo "Nothing to clean" 12 | 13 | realclean: 14 | rm -f *.pdf 15 | 16 | clobber: realclean 17 | -------------------------------------------------------------------------------- /doc/lrm/app_postfile.tex: -------------------------------------------------------------------------------- 1 | %%% Local Variables: 2 | %%% mode: latex 3 | %%% TeX-master: "caph" 4 | %%% End: 5 | -------------------------------------------------------------------------------- /doc/lrm/dynamic.tex: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jserot/caph/2b3b241f0c32aa4fcaf60d4b8529956cca8aa6b1/doc/lrm/dynamic.tex -------------------------------------------------------------------------------- /doc/lrm/fifoif.tex: -------------------------------------------------------------------------------- 1 | \chapter{Writing your own FIFO model} 2 | \label{cha:fifos} 3 | 4 | TBW 5 | 6 | %%% Local Variables: 7 | %%% mode: latex 8 | %%% TeX-master: "caph-lrm" 9 | %%% End: 10 | -------------------------------------------------------------------------------- /doc/lrm/figs/act-class-ex.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jserot/caph/2b3b241f0c32aa4fcaf60d4b8529956cca8aa6b1/doc/lrm/figs/act-class-ex.pdf -------------------------------------------------------------------------------- /doc/lrm/figs/actornet.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jserot/caph/2b3b241f0c32aa4fcaf60d4b8529956cca8aa6b1/doc/lrm/figs/actornet.pdf -------------------------------------------------------------------------------- /doc/lrm/figs/addinc.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jserot/caph/2b3b241f0c32aa4fcaf60d4b8529956cca8aa6b1/doc/lrm/figs/addinc.pdf -------------------------------------------------------------------------------- /doc/lrm/figs/addinc2.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jserot/caph/2b3b241f0c32aa4fcaf60d4b8529956cca8aa6b1/doc/lrm/figs/addinc2.pdf -------------------------------------------------------------------------------- /doc/lrm/figs/biggernet.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jserot/caph/2b3b241f0c32aa4fcaf60d4b8529956cca8aa6b1/doc/lrm/figs/biggernet.pdf -------------------------------------------------------------------------------- /doc/lrm/figs/box-fsm.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jserot/caph/2b3b241f0c32aa4fcaf60d4b8529956cca8aa6b1/doc/lrm/figs/box-fsm.pdf -------------------------------------------------------------------------------- /doc/lrm/figs/caph-icon.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jserot/caph/2b3b241f0c32aa4fcaf60d4b8529956cca8aa6b1/doc/lrm/figs/caph-icon.pdf -------------------------------------------------------------------------------- /doc/lrm/figs/caph-logo.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jserot/caph/2b3b241f0c32aa4fcaf60d4b8529956cca8aa6b1/doc/lrm/figs/caph-logo.pdf -------------------------------------------------------------------------------- /doc/lrm/figs/chain-ex.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jserot/caph/2b3b241f0c32aa4fcaf60d4b8529956cca8aa6b1/doc/lrm/figs/chain-ex.pdf -------------------------------------------------------------------------------- /doc/lrm/figs/closednet.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jserot/caph/2b3b241f0c32aa4fcaf60d4b8529956cca8aa6b1/doc/lrm/figs/closednet.pdf -------------------------------------------------------------------------------- /doc/lrm/figs/datarepr.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jserot/caph/2b3b241f0c32aa4fcaf60d4b8529956cca8aa6b1/doc/lrm/figs/datarepr.pdf -------------------------------------------------------------------------------- /doc/lrm/figs/datarepresentation.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jserot/caph/2b3b241f0c32aa4fcaf60d4b8529956cca8aa6b1/doc/lrm/figs/datarepresentation.pdf -------------------------------------------------------------------------------- /doc/lrm/figs/diamond.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jserot/caph/2b3b241f0c32aa4fcaf60d4b8529956cca8aa6b1/doc/lrm/figs/diamond.pdf -------------------------------------------------------------------------------- /doc/lrm/figs/diamonds.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jserot/caph/2b3b241f0c32aa4fcaf60d4b8529956cca8aa6b1/doc/lrm/figs/diamonds.pdf -------------------------------------------------------------------------------- /doc/lrm/figs/fifo-sizes-comp.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jserot/caph/2b3b241f0c32aa4fcaf60d4b8529956cca8aa6b1/doc/lrm/figs/fifo-sizes-comp.pdf -------------------------------------------------------------------------------- /doc/lrm/figs/fir1n-ex.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jserot/caph/2b3b241f0c32aa4fcaf60d4b8529956cca8aa6b1/doc/lrm/figs/fir1n-ex.pdf -------------------------------------------------------------------------------- /doc/lrm/figs/foldl-ex1.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jserot/caph/2b3b241f0c32aa4fcaf60d4b8529956cca8aa6b1/doc/lrm/figs/foldl-ex1.pdf -------------------------------------------------------------------------------- /doc/lrm/figs/foldt-ex.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jserot/caph/2b3b241f0c32aa4fcaf60d4b8529956cca8aa6b1/doc/lrm/figs/foldt-ex.pdf -------------------------------------------------------------------------------- /doc/lrm/figs/fouractors.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jserot/caph/2b3b241f0c32aa4fcaf60d4b8529956cca8aa6b1/doc/lrm/figs/fouractors.pdf -------------------------------------------------------------------------------- /doc/lrm/figs/grad-net.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jserot/caph/2b3b241f0c32aa4fcaf60d4b8529956cca8aa6b1/doc/lrm/figs/grad-net.pdf -------------------------------------------------------------------------------- /doc/lrm/figs/grad-net2.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jserot/caph/2b3b241f0c32aa4fcaf60d4b8529956cca8aa6b1/doc/lrm/figs/grad-net2.pdf -------------------------------------------------------------------------------- /doc/lrm/figs/inc2f.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jserot/caph/2b3b241f0c32aa4fcaf60d4b8529956cca8aa6b1/doc/lrm/figs/inc2f.pdf -------------------------------------------------------------------------------- /doc/lrm/figs/languagestruct.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jserot/caph/2b3b241f0c32aa4fcaf60d4b8529956cca8aa6b1/doc/lrm/figs/languagestruct.pdf -------------------------------------------------------------------------------- /doc/lrm/figs/lena128-grad.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jserot/caph/2b3b241f0c32aa4fcaf60d4b8529956cca8aa6b1/doc/lrm/figs/lena128-grad.pdf -------------------------------------------------------------------------------- /doc/lrm/figs/lena128.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jserot/caph/2b3b241f0c32aa4fcaf60d4b8529956cca8aa6b1/doc/lrm/figs/lena128.pdf -------------------------------------------------------------------------------- /doc/lrm/figs/map-ex0.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jserot/caph/2b3b241f0c32aa4fcaf60d4b8529956cca8aa6b1/doc/lrm/figs/map-ex0.pdf -------------------------------------------------------------------------------- /doc/lrm/figs/map-ex1.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jserot/caph/2b3b241f0c32aa4fcaf60d4b8529956cca8aa6b1/doc/lrm/figs/map-ex1.pdf -------------------------------------------------------------------------------- /doc/lrm/figs/map-ex2.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jserot/caph/2b3b241f0c32aa4fcaf60d4b8529956cca8aa6b1/doc/lrm/figs/map-ex2.pdf -------------------------------------------------------------------------------- /doc/lrm/figs/map-ex3.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jserot/caph/2b3b241f0c32aa4fcaf60d4b8529956cca8aa6b1/doc/lrm/figs/map-ex3.pdf -------------------------------------------------------------------------------- /doc/lrm/figs/map2-ex1.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jserot/caph/2b3b241f0c32aa4fcaf60d4b8529956cca8aa6b1/doc/lrm/figs/map2-ex1.pdf -------------------------------------------------------------------------------- /doc/lrm/figs/mapi-ex1.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jserot/caph/2b3b241f0c32aa4fcaf60d4b8529956cca8aa6b1/doc/lrm/figs/mapi-ex1.pdf -------------------------------------------------------------------------------- /doc/lrm/figs/mergeactor.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jserot/caph/2b3b241f0c32aa4fcaf60d4b8529956cca8aa6b1/doc/lrm/figs/mergeactor.pdf -------------------------------------------------------------------------------- /doc/lrm/figs/napp-ex1.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jserot/caph/2b3b241f0c32aa4fcaf60d4b8529956cca8aa6b1/doc/lrm/figs/napp-ex1.pdf -------------------------------------------------------------------------------- /doc/lrm/figs/napp-ex2.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jserot/caph/2b3b241f0c32aa4fcaf60d4b8529956cca8aa6b1/doc/lrm/figs/napp-ex2.pdf -------------------------------------------------------------------------------- /doc/lrm/figs/nappi-ex1.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jserot/caph/2b3b241f0c32aa4fcaf60d4b8529956cca8aa6b1/doc/lrm/figs/nappi-ex1.pdf -------------------------------------------------------------------------------- /doc/lrm/figs/networkfour.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jserot/caph/2b3b241f0c32aa4fcaf60d4b8529956cca8aa6b1/doc/lrm/figs/networkfour.pdf -------------------------------------------------------------------------------- /doc/lrm/figs/pipe-ex.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jserot/caph/2b3b241f0c32aa4fcaf60d4b8529956cca8aa6b1/doc/lrm/figs/pipe-ex.pdf -------------------------------------------------------------------------------- /doc/lrm/figs/rec1.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jserot/caph/2b3b241f0c32aa4fcaf60d4b8529956cca8aa6b1/doc/lrm/figs/rec1.pdf -------------------------------------------------------------------------------- /doc/lrm/figs/rec2.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jserot/caph/2b3b241f0c32aa4fcaf60d4b8529956cca8aa6b1/doc/lrm/figs/rec2.pdf -------------------------------------------------------------------------------- /doc/lrm/figs/sample-act-fsm.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jserot/caph/2b3b241f0c32aa4fcaf60d4b8529956cca8aa6b1/doc/lrm/figs/sample-act-fsm.pdf -------------------------------------------------------------------------------- /doc/lrm/figs/sample2-act.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jserot/caph/2b3b241f0c32aa4fcaf60d4b8529956cca8aa6b1/doc/lrm/figs/sample2-act.pdf -------------------------------------------------------------------------------- /doc/lrm/figs/sample4-act.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jserot/caph/2b3b241f0c32aa4fcaf60d4b8529956cca8aa6b1/doc/lrm/figs/sample4-act.pdf -------------------------------------------------------------------------------- /doc/lrm/figs/sdf-fifosizes-ex.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jserot/caph/2b3b241f0c32aa4fcaf60d4b8529956cca8aa6b1/doc/lrm/figs/sdf-fifosizes-ex.pdf -------------------------------------------------------------------------------- /doc/lrm/figs/select-dpn.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jserot/caph/2b3b241f0c32aa4fcaf60d4b8529956cca8aa6b1/doc/lrm/figs/select-dpn.pdf -------------------------------------------------------------------------------- /doc/lrm/figs/smallnet.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jserot/caph/2b3b241f0c32aa4fcaf60d4b8529956cca8aa6b1/doc/lrm/figs/smallnet.pdf -------------------------------------------------------------------------------- /doc/lrm/figs/smallnet1.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jserot/caph/2b3b241f0c32aa4fcaf60d4b8529956cca8aa6b1/doc/lrm/figs/smallnet1.pdf -------------------------------------------------------------------------------- /doc/lrm/figs/smallnet2.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jserot/caph/2b3b241f0c32aa4fcaf60d4b8529956cca8aa6b1/doc/lrm/figs/smallnet2.pdf -------------------------------------------------------------------------------- /doc/lrm/figs/suml-act-fsm.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jserot/caph/2b3b241f0c32aa4fcaf60d4b8529956cca8aa6b1/doc/lrm/figs/suml-act-fsm.pdf -------------------------------------------------------------------------------- /doc/lrm/figs/suml-fsm.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jserot/caph/2b3b241f0c32aa4fcaf60d4b8529956cca8aa6b1/doc/lrm/figs/suml-fsm.pdf -------------------------------------------------------------------------------- /doc/lrm/figs/suml-rec.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jserot/caph/2b3b241f0c32aa4fcaf60d4b8529956cca8aa6b1/doc/lrm/figs/suml-rec.pdf -------------------------------------------------------------------------------- /doc/lrm/figs/switch-act-fsm.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jserot/caph/2b3b241f0c32aa4fcaf60d4b8529956cca8aa6b1/doc/lrm/figs/switch-act-fsm.pdf -------------------------------------------------------------------------------- /doc/lrm/figs/switch-ex.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jserot/caph/2b3b241f0c32aa4fcaf60d4b8529956cca8aa6b1/doc/lrm/figs/switch-ex.pdf -------------------------------------------------------------------------------- /doc/lrm/figs/toolset.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jserot/caph/2b3b241f0c32aa4fcaf60d4b8529956cca8aa6b1/doc/lrm/figs/toolset.pdf -------------------------------------------------------------------------------- /doc/lrm/figs/twice.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jserot/caph/2b3b241f0c32aa4fcaf60d4b8529956cca8aa6b1/doc/lrm/figs/twice.pdf -------------------------------------------------------------------------------- /doc/lrm/figs/types.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jserot/caph/2b3b241f0c32aa4fcaf60d4b8529956cca8aa6b1/doc/lrm/figs/types.pdf -------------------------------------------------------------------------------- /doc/lrm/interm.tex: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jserot/caph/2b3b241f0c32aa4fcaf60d4b8529956cca8aa6b1/doc/lrm/interm.tex -------------------------------------------------------------------------------- /doc/lrm/overview.tex: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jserot/caph/2b3b241f0c32aa4fcaf60d4b8529956cca8aa6b1/doc/lrm/overview.tex -------------------------------------------------------------------------------- /doc/primer/Makefile: -------------------------------------------------------------------------------- 1 | include ../../config 2 | 3 | SRCS=caph-primer.tex 4 | DOC=caph-primer 5 | 6 | all: caph-primer.pdf 7 | 8 | ifeq ($(PLATFORM), win32) 9 | install: 10 | else 11 | install: caph-primer.pdf 12 | endif 13 | $(INSTALL) -d $(DOCDIR) 14 | $(CP) caph-primer.pdf $(DOCDIR) 15 | 16 | caph-primer.pdf: caph-primer.tex 17 | pdflatex caph-primer.tex > pdflatex.log 18 | pdflatex caph-primer.tex > pdflatex.log 19 | 20 | clean: 21 | rm -f *.dvi *.log *.rel *.aux *.toc 22 | 23 | realclean: clobber 24 | 25 | clobber: clean 26 | rm -f caph-primer.pdf *~ 27 | -------------------------------------------------------------------------------- /doc/primer/biblio.bbl: -------------------------------------------------------------------------------- 1 | \begin{thebibliography}{1} 2 | 3 | \bibitem{graphivz} 4 | Graphviz - graph visualization software. 5 | 6 | \end{thebibliography} 7 | -------------------------------------------------------------------------------- /doc/primer/figs/caph-logo.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jserot/caph/2b3b241f0c32aa4fcaf60d4b8529956cca8aa6b1/doc/primer/figs/caph-logo.pdf -------------------------------------------------------------------------------- /doc/primer/figs/cconv.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jserot/caph/2b3b241f0c32aa4fcaf60d4b8529956cca8aa6b1/doc/primer/figs/cconv.pdf -------------------------------------------------------------------------------- /doc/primer/figs/conv-a.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jserot/caph/2b3b241f0c32aa4fcaf60d4b8529956cca8aa6b1/doc/primer/figs/conv-a.pdf -------------------------------------------------------------------------------- /doc/primer/figs/conv-b.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jserot/caph/2b3b241f0c32aa4fcaf60d4b8529956cca8aa6b1/doc/primer/figs/conv-b.pdf -------------------------------------------------------------------------------- /doc/primer/figs/dx_act.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jserot/caph/2b3b241f0c32aa4fcaf60d4b8529956cca8aa6b1/doc/primer/figs/dx_act.pdf -------------------------------------------------------------------------------- /doc/primer/figs/dy_act.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jserot/caph/2b3b241f0c32aa4fcaf60d4b8529956cca8aa6b1/doc/primer/figs/dy_act.pdf -------------------------------------------------------------------------------- /doc/primer/figs/grad-dot.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jserot/caph/2b3b241f0c32aa4fcaf60d4b8529956cca8aa6b1/doc/primer/figs/grad-dot.pdf -------------------------------------------------------------------------------- /doc/primer/figs/ide/config.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jserot/caph/2b3b241f0c32aa4fcaf60d4b8529956cca8aa6b1/doc/primer/figs/ide/config.pdf -------------------------------------------------------------------------------- /doc/primer/figs/ide/create-project.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jserot/caph/2b3b241f0c32aa4fcaf60d4b8529956cca8aa6b1/doc/primer/figs/ide/create-project.pdf -------------------------------------------------------------------------------- /doc/primer/figs/ide/first-program.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jserot/caph/2b3b241f0c32aa4fcaf60d4b8529956cca8aa6b1/doc/primer/figs/ide/first-program.pdf -------------------------------------------------------------------------------- /doc/primer/figs/ide/main-window-empty.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jserot/caph/2b3b241f0c32aa4fcaf60d4b8529956cca8aa6b1/doc/primer/figs/ide/main-window-empty.pdf -------------------------------------------------------------------------------- /doc/primer/figs/ide/main-window.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jserot/caph/2b3b241f0c32aa4fcaf60d4b8529956cca8aa6b1/doc/primer/figs/ide/main-window.pdf -------------------------------------------------------------------------------- /doc/primer/figs/ide/make-dot.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jserot/caph/2b3b241f0c32aa4fcaf60d4b8529956cca8aa6b1/doc/primer/figs/ide/make-dot.pdf -------------------------------------------------------------------------------- /doc/primer/figs/ide/make-sim.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jserot/caph/2b3b241f0c32aa4fcaf60d4b8529956cca8aa6b1/doc/primer/figs/ide/make-sim.pdf -------------------------------------------------------------------------------- /doc/primer/figs/ide/make-systemc.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jserot/caph/2b3b241f0c32aa4fcaf60d4b8529956cca8aa6b1/doc/primer/figs/ide/make-systemc.pdf -------------------------------------------------------------------------------- /doc/primer/figs/ide/make-vhdl.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jserot/caph/2b3b241f0c32aa4fcaf60d4b8529956cca8aa6b1/doc/primer/figs/ide/make-vhdl.pdf -------------------------------------------------------------------------------- /doc/primer/figs/ide/opened-project.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jserot/caph/2b3b241f0c32aa4fcaf60d4b8529956cca8aa6b1/doc/primer/figs/ide/opened-project.pdf -------------------------------------------------------------------------------- /doc/primer/figs/ide/opening-project.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jserot/caph/2b3b241f0c32aa4fcaf60d4b8529956cca8aa6b1/doc/primer/figs/ide/opening-project.pdf -------------------------------------------------------------------------------- /doc/primer/figs/ide/options-sysc.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jserot/caph/2b3b241f0c32aa4fcaf60d4b8529956cca8aa6b1/doc/primer/figs/ide/options-sysc.pdf -------------------------------------------------------------------------------- /doc/primer/figs/ide/options.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jserot/caph/2b3b241f0c32aa4fcaf60d4b8529956cca8aa6b1/doc/primer/figs/ide/options.pdf -------------------------------------------------------------------------------- /doc/primer/figs/ide/project-main-done.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jserot/caph/2b3b241f0c32aa4fcaf60d4b8529956cca8aa6b1/doc/primer/figs/ide/project-main-done.pdf -------------------------------------------------------------------------------- /doc/primer/figs/ide/project-main.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jserot/caph/2b3b241f0c32aa4fcaf60d4b8529956cca8aa6b1/doc/primer/figs/ide/project-main.pdf -------------------------------------------------------------------------------- /doc/primer/figs/ide/project-make.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jserot/caph/2b3b241f0c32aa4fcaf60d4b8529956cca8aa6b1/doc/primer/figs/ide/project-make.pdf -------------------------------------------------------------------------------- /doc/primer/figs/ide/write-sample.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jserot/caph/2b3b241f0c32aa4fcaf60d4b8529956cca8aa6b1/doc/primer/figs/ide/write-sample.pdf -------------------------------------------------------------------------------- /doc/primer/figs/img4.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jserot/caph/2b3b241f0c32aa4fcaf60d4b8529956cca8aa6b1/doc/primer/figs/img4.pdf -------------------------------------------------------------------------------- /doc/primer/figs/inv-dot.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jserot/caph/2b3b241f0c32aa4fcaf60d4b8529956cca8aa6b1/doc/primer/figs/inv-dot.pdf -------------------------------------------------------------------------------- /doc/primer/figs/inv-result.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jserot/caph/2b3b241f0c32aa4fcaf60d4b8529956cca8aa6b1/doc/primer/figs/inv-result.pdf -------------------------------------------------------------------------------- /doc/primer/figs/lena128.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jserot/caph/2b3b241f0c32aa4fcaf60d4b8529956cca8aa6b1/doc/primer/figs/lena128.pdf -------------------------------------------------------------------------------- /doc/primer/figs/networkfour.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jserot/caph/2b3b241f0c32aa4fcaf60d4b8529956cca8aa6b1/doc/primer/figs/networkfour.pdf -------------------------------------------------------------------------------- /doc/primer/figs/pcb-res.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jserot/caph/2b3b241f0c32aa4fcaf60d4b8529956cca8aa6b1/doc/primer/figs/pcb-res.pdf -------------------------------------------------------------------------------- /doc/primer/figs/pcb.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jserot/caph/2b3b241f0c32aa4fcaf60d4b8529956cca8aa6b1/doc/primer/figs/pcb.pdf -------------------------------------------------------------------------------- /doc/primer/figs/simple-dot.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jserot/caph/2b3b241f0c32aa4fcaf60d4b8529956cca8aa6b1/doc/primer/figs/simple-dot.pdf -------------------------------------------------------------------------------- /doc/primer/figs/simple-quartus-1.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jserot/caph/2b3b241f0c32aa4fcaf60d4b8529956cca8aa6b1/doc/primer/figs/simple-quartus-1.pdf -------------------------------------------------------------------------------- /doc/primer/figs/simple-quartus-2.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jserot/caph/2b3b241f0c32aa4fcaf60d4b8529956cca8aa6b1/doc/primer/figs/simple-quartus-2.pdf -------------------------------------------------------------------------------- /doc/primer/figs/simple-quartus-3.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jserot/caph/2b3b241f0c32aa4fcaf60d4b8529956cca8aa6b1/doc/primer/figs/simple-quartus-3.pdf -------------------------------------------------------------------------------- /doc/primer/figs/simple-quartus-4.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jserot/caph/2b3b241f0c32aa4fcaf60d4b8529956cca8aa6b1/doc/primer/figs/simple-quartus-4.pdf -------------------------------------------------------------------------------- /doc/primer/figs/simple-quartus-5.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jserot/caph/2b3b241f0c32aa4fcaf60d4b8529956cca8aa6b1/doc/primer/figs/simple-quartus-5.pdf -------------------------------------------------------------------------------- /doc/primer/figs/simple-quartus-6.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jserot/caph/2b3b241f0c32aa4fcaf60d4b8529956cca8aa6b1/doc/primer/figs/simple-quartus-6.pdf -------------------------------------------------------------------------------- /doc/primer/figs/simple-quartus-7.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jserot/caph/2b3b241f0c32aa4fcaf60d4b8529956cca8aa6b1/doc/primer/figs/simple-quartus-7.pdf -------------------------------------------------------------------------------- /doc/primer/figs/simple-waves.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jserot/caph/2b3b241f0c32aa4fcaf60d4b8529956cca8aa6b1/doc/primer/figs/simple-waves.pdf -------------------------------------------------------------------------------- /doc/primer/figs/sobel-dot.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jserot/caph/2b3b241f0c32aa4fcaf60d4b8529956cca8aa6b1/doc/primer/figs/sobel-dot.pdf -------------------------------------------------------------------------------- /doc/primer/figs/sobel-full.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jserot/caph/2b3b241f0c32aa4fcaf60d4b8529956cca8aa6b1/doc/primer/figs/sobel-full.pdf -------------------------------------------------------------------------------- /doc/primer/figs/sobel-quartus-1.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jserot/caph/2b3b241f0c32aa4fcaf60d4b8529956cca8aa6b1/doc/primer/figs/sobel-quartus-1.pdf -------------------------------------------------------------------------------- /doc/primer/figs/sobel-quartus-2.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jserot/caph/2b3b241f0c32aa4fcaf60d4b8529956cca8aa6b1/doc/primer/figs/sobel-quartus-2.pdf -------------------------------------------------------------------------------- /doc/primer/figs/sobel-quartus-3.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jserot/caph/2b3b241f0c32aa4fcaf60d4b8529956cca8aa6b1/doc/primer/figs/sobel-quartus-3.pdf -------------------------------------------------------------------------------- /doc/primer/figs/toolset.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jserot/caph/2b3b241f0c32aa4fcaf60d4b8529956cca8aa6b1/doc/primer/figs/toolset.pdf -------------------------------------------------------------------------------- /etc/Makefile: -------------------------------------------------------------------------------- 1 | include ../config 2 | 3 | clean: 4 | rm -f *~ 5 | 6 | realclean: clean 7 | 8 | clobber: realclean 9 | -------------------------------------------------------------------------------- /etc/do_test: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # A script for automated testing 4 | 5 | function try_make 6 | { 7 | make $1 8 | case $? in 9 | 0) echo "OK";; 10 | *) echo "FAILED"; 11 | esac 12 | } 13 | 14 | TMP=/tmp/do_test.out 15 | 16 | if [ $1 = "-show" ] 17 | then 18 | shift 19 | echo "Running test $1 in $2... " 20 | (cd $2; make clobber; make $1.makefile; make $1; make show; make clobber) 2>&1 | grep "Result" 21 | elif [ $1 = "-verbose" ] 22 | then 23 | shift 24 | echo "Running test $1 in $2... " 25 | (cd $2; make clobber; make $1.makefile; make $1; make show; make clobber) 2>&1 26 | else 27 | echo -n "Testing $1 in $2... " 28 | (cd $2; make clobber; make $1.makefile) > $TMP 2>&1 29 | (cd $2; try_make $1; make clobber) > $TMP 2>&1 30 | grep "OK\|FAILED" $TMP 31 | grep "OK" $TMP >/dev/null && exit 1 32 | exit 0 33 | fi 34 | -------------------------------------------------------------------------------- /etc/mk_caphy_proj: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # set CAPHDIR env var, cd to target dir and run 4 | 5 | DOTTY=/Users/jserot/bin/graphviz 6 | 7 | $CAPHDIR/bin/caphmake -caph_dir $CAPHDIR > /dev/null 8 | make clobber > /dev/null 9 | rm Makefile 10 | $CAPHDIR/bin/mkproject -D CAPHLIB=$CAPHDIR/lib/caph -caphc $CAPHDIR/bin/caph -dotty $DOTTY *.proj 11 | -------------------------------------------------------------------------------- /etc/searchpath: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Find a program in the path 3 | 4 | IFS=':' 5 | for dir in $PATH; do 6 | if test -z "$dir"; then dir=.; fi 7 | if test -f $dir/$1; then exit 0; fi 8 | done 9 | exit 1 10 | -------------------------------------------------------------------------------- /examples/Makefile: -------------------------------------------------------------------------------- 1 | SUBDIRS=working #tocheck tofix working nextvers tosee 2 | 3 | install: 4 | (cd working; make install) 5 | 6 | clean: 7 | @for i in $(SUBDIRS); do (cd $$i; make clean); done 8 | 9 | clobber: 10 | @for i in $(SUBDIRS); do (cd $$i; make clobber); done 11 | 12 | realclean: clobber 13 | -------------------------------------------------------------------------------- /examples/build_dir: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # This script automatically (re)builds the directory hierarchy required for automated testing 4 | # within an example directory 5 | # Added v2.9.1, May 2019 6 | 7 | if [ ! -d ./dot ]; then mkdir dot; fi 8 | if [ ! -d ./sim ]; then mkdir sim; fi 9 | if [ ! -d ./systemc ]; then mkdir systemc; fi 10 | if [ ! -d ./vhdl ]; then mkdir vhdl; fi 11 | (cd ./vhdl; if [ ! -e systemc ]; then ln -s ../systemc .; fi) 12 | if [ -d ./extra ] 13 | then 14 | (cd ./sim; for i in ../extra/*.ml; do if [ -e $i ]; then ln -sf $i .; fi; done) 15 | (cd ./systemc; for i in ../extra/*.{h,cpp}; do if [ -e $i ]; then ln -sf $i .; fi; done) 16 | (cd ./vhdl; for i in ../extra/*.vhd; do if [ -e $i ]; then ln -sf $i .; fi; done) 17 | fi 18 | -------------------------------------------------------------------------------- /examples/imgs/feep.pgm: -------------------------------------------------------------------------------- 1 | P2 2 | 24 7 3 | 15 4 | 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 5 | 0 3 3 3 3 0 0 7 7 7 7 0 0 11 11 11 11 0 0 15 15 15 15 0 6 | 0 3 0 0 0 0 0 7 0 0 0 0 0 11 0 0 0 0 0 15 0 0 15 0 7 | 0 3 3 3 0 0 0 7 7 7 0 0 0 11 11 11 0 0 0 15 15 15 15 0 8 | 0 3 0 0 0 0 0 7 0 0 0 0 0 11 0 0 0 0 0 15 0 0 0 0 9 | 0 3 0 0 0 0 0 7 7 7 7 0 0 11 11 11 11 0 0 15 0 0 0 0 10 | 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 11 | -------------------------------------------------------------------------------- /examples/working/Compute_mocs: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | caphmake=$CAPH/bin/caphmake 3 | caphc=$CAPH/bin/caphc 4 | resfile=mocs_summary.csv 5 | for i in [a-z]*/[a-z]* 6 | do 7 | (cd $i; echo $i; $caphmake > /dev/null; make clean > /dev/null ; make dot CAPHC="$caphc -infer_mocs" | grep "^Wrote.*\.dat") 8 | done 9 | echo "" > $resfile 10 | nf=0 11 | for i in [a-z]*/[a-z]* 12 | do 13 | f=$i/*_mocs.dat 14 | if [ -e $f ] 15 | then 16 | cat $f >> $resfile 17 | nf=`expr $nf + 1` 18 | else 19 | echo "** no file $f found" 20 | fi 21 | done 22 | echo "Wrote $nf lines in file $resfile" 23 | 24 | -------------------------------------------------------------------------------- /examples/working/Makefile: -------------------------------------------------------------------------------- 1 | include ../../config 2 | 3 | clean: 4 | for i in [a-z]*/[a-z0-9_]*; do (cd $$i; if [ -e Makefile ]; then make -s clean; fi) done 5 | 6 | clobber: 7 | for i in [a-z]*/[a-z0-9_]*; do (cd $$i; if [ -e Makefile ]; then make -s clobber; fi; rm -f ./caph.output; rm -f ./*~; rm -f *_mocs.dat) done 8 | 9 | rebuild: 10 | for i in [a-z]*/[a-z0-9_]*; do (echo "(Re)building directories in $$i:"; cd $$i; ../../../build_dir) done 11 | 12 | 13 | install: 14 | $(INSTALL) -d $(EXAMPLEDIR) 15 | cp ./Readme $(EXAMPLEDIR) 16 | @for i in [a-z]*; do cp -r $$i $(EXAMPLEDIR); done 17 | -------------------------------------------------------------------------------- /examples/working/apps/binimg/main.cph: -------------------------------------------------------------------------------- 1 | -- Image binarization 2 | -- All pixels with value greater than the specified threshold become 255, the others 0. 3 | -- The binarization threshold is here passed as a command line argument (arg2) 4 | -- An alternate version, using HO actors is given in [../ho/binimg] 5 | 6 | #include "dc.cph" 7 | 8 | actor thr (t:signed) 9 | in (a:signed dc) 10 | out (c:unsigned<8> dc) 11 | rules a -> c 12 | | '< -> '< 13 | | '> -> '> 14 | | 'p -> if p > t then '255 else '0 15 | ; 16 | 17 | stream inp:signed<10> dc from %ifile; 18 | stream res:unsigned<8> dc to "result.txt"; 19 | 20 | net res = thr %arg2 inp; 21 | -------------------------------------------------------------------------------- /examples/working/apps/binimg/main.procs: -------------------------------------------------------------------------------- 1 | PRE_PROC = pgm2txt -abbrev lena64.pgm lena64.txt 2 | POST_PROC = txt2pgm -abbrev 255 sim/result.txt sim/result.pgm 3 | -------------------------------------------------------------------------------- /examples/working/apps/binimg/main.proj: -------------------------------------------------------------------------------- 1 | DOT_OPTS = -D ifile=lena64.pgm -D arg2=120S 2 | SIM_OPTS = -chan_cap 130 -suppress_cast_warnings -D ifile=lena64.pgm -D arg2=120S -abbrev_dc_ctors 3 | SC_OPTS = -suppress_cast_warnings -D ifile=lena64.pgm -D arg2=120S -sc_default_fifo_capacity 256 -sc_stop_time 200000 -sc_abbrev_dc_ctors -sc_dump_fifo_stats 4 | VHDL_OPTS = -D ifile=lena64.pgm -D arg2=120S -vhdl_annot_file binimg_fifo_stats.dat 5 | GHDL_RUN_OPTS = --stop-time=400000ns 6 | XDF_OPTS = -D ifile=lena64.pgm -D arg2=120S 7 | 8 | binimg_fifo_stats.dat: systemc.run 9 | 10 | -------------------------------------------------------------------------------- /examples/working/apps/blob/main.proj: -------------------------------------------------------------------------------- 1 | DOT_OPTS = -D arg1=10000 -D arg2=3000 -suppress_cast_warnings 2 | SIM_OPTS = -D arg1=10000 -D arg2=3000 -abbrev_dc_ctors -chan_cap 6000 -suppress_cast_warnings -warn_channels -dump_channel_stats 3 | SC_OPTS = -D arg1=10000 -D arg2=3000 -sc_default_fifo_capacity 16000 -suppress_cast_warnings -sc_dump_fifo_stats -sc_stop_time 128000 -sc_abbrev_dc_ctors 4 | VHDL_OPTS = -D arg1=10000 -D arg2=3000 -suppress_cast_warnings -vhdl_annot_file ./systemc/fifo_stats.dat 5 | GHDL_RUN_OPTS = --stop-time=400000ns 6 | 7 | -------------------------------------------------------------------------------- /examples/working/apps/dx_v1/main.cph: -------------------------------------------------------------------------------- 1 | -- Computes the horizontal derivative on images 2 | -- This version uses the [d1p] actor defined in the standard library 3 | 4 | #include "img_ops.cph" 5 | 6 | type pixel == signed<8> dc; 7 | 8 | actor sub -- SUB:, = 9 | in (a:pixel, b:pixel) 10 | out (c:pixel) 11 | rules (a,b) -> c 12 | | ('<, '<) -> '< 13 | | ('v1, 'v2) -> '(v1-v2) 14 | | ('>, '>) -> '>; 15 | 16 | stream i:pixel from "sample.txt"; 17 | stream o:pixel to "result.txt"; 18 | 19 | net o = sub (i, d1p 0 i); 20 | -------------------------------------------------------------------------------- /examples/working/apps/dx_v1/main.proj: -------------------------------------------------------------------------------- 1 | SIM_OPTS = -abbrev_dc_ctors 2 | SC_OPTS = -sc_stop_time 800 -sc_abbrev_dc_ctors 3 | VHDL_OPTS = 4 | GHDL_RUN_OPTS = --stop-time=800ns 5 | -------------------------------------------------------------------------------- /examples/working/apps/dx_v1/sample.txt: -------------------------------------------------------------------------------- 1 | < < 10 30 55 90 > < 33 53 60 12 > < 99 56 23 11 > < 11 82 46 11 > > 2 | -------------------------------------------------------------------------------- /examples/working/apps/dx_v2/main.cph: -------------------------------------------------------------------------------- 1 | -- Computes the horizontal derivative on images a line 2 | -- This version uses a standalone actor 3 | 4 | #include "dc.cph" 5 | 6 | type pixel == signed<8> dc; 7 | 8 | stream i:pixel from "sample.txt"; 9 | stream o:pixel to "result.txt"; 10 | 11 | actor dx (v:$t) 12 | in (a:$t dc) 13 | out (c:$t dc) 14 | var s : {S0,S1,S2} = S0 15 | var z : $t 16 | rules 17 | | (s:S0, a:'<) -> (s:S1, c:'<) 18 | | (s:S1, a:'>) -> (s:S0, c:'>) 19 | | (s:S1, a:'<) -> (s:S2, c:'<, z:v) 20 | | (s:S2, a:'p) -> (s:S2, c:'(p-z), z:p) 21 | | (s:S2, a:'>) -> (s:S1, c:'>) 22 | ; 23 | 24 | net o = dx 0 i; 25 | -------------------------------------------------------------------------------- /examples/working/apps/dx_v2/main.proj: -------------------------------------------------------------------------------- 1 | DOT_OPTS = 2 | SIM_OPTS = -abbrev_dc_ctors 3 | SC_OPTS = -sc_stop_time 400 -sc_abbrev_dc_ctors 4 | VHDL_OPTS = 5 | GHDL_RUN_OPTS = --stop-time=600ns 6 | -------------------------------------------------------------------------------- /examples/working/apps/dx_v2/sample.txt: -------------------------------------------------------------------------------- 1 | < < 10 30 55 90 > < 33 53 60 12 > < 99 56 23 11 > < 11 82 46 11 > > 2 | -------------------------------------------------------------------------------- /examples/working/apps/dy/img0.txt: -------------------------------------------------------------------------------- 1 | < < 1 2 > < 3 4 > < 5 6 > < 7 8 > > 2 | -------------------------------------------------------------------------------- /examples/working/apps/dy/img1.txt: -------------------------------------------------------------------------------- 1 | < < 1 2 3 > < 5 6 7 > < 9 10 11 > < 13 14 15 > > < < 1 2 3 > < 6 7 8 > < 11 12 13 > < 16 17 18 > > 2 | -------------------------------------------------------------------------------- /examples/working/apps/dy/img2.txt: -------------------------------------------------------------------------------- 1 | < < 0 0 0 0 0 0 0 0 > < 0 0 10 10 10 10 0 0 > < 0 0 10 10 10 10 0 0 > < 0 0 10 10 10 10 0 0 > < 0 0 10 10 10 10 0 0 > < 0 0 0 0 0 0 0 0 > > 2 | -------------------------------------------------------------------------------- /examples/working/apps/dy/img3.txt: -------------------------------------------------------------------------------- 1 | < < 11 12 13 14 > < 21 22 23 24 > < 31 32 33 34 > > 2 | -------------------------------------------------------------------------------- /examples/working/apps/dy/main.cph: -------------------------------------------------------------------------------- 1 | -- Computes the vertical derivative on a image 2 | 3 | #include "img_ops.cph" 4 | 5 | type pixel == signed<8>; 6 | 7 | actor sub () 8 | in (a:pixel dc, b:pixel dc) 9 | out (c:pixel dc) 10 | rules (a, b) -> c 11 | | ('<, '<) -> '< 12 | | ('p1, 'p2) -> '(p1-p2) 13 | | ('>, '>) -> '>; 14 | 15 | stream i:pixel dc from "sample.txt"; 16 | stream o:pixel dc to "result.txt"; 17 | 18 | net o = sub (i, d1l 0 i); -- The one-line delay [d1l] actor is defined in "img_ops.cph" 19 | -------------------------------------------------------------------------------- /examples/working/apps/dy/main.proj: -------------------------------------------------------------------------------- 1 | DOT_OPTS = 2 | SIM_OPTS = -abbrev_dc_ctors 3 | SC_OPTS = -sc_stop_time 600 -sc_abbrev_dc_ctors -sc_dump_fifo_stats 4 | VHDL_OPTS = -vhdl_annot_file ./systemc/fifo_stats.dat 5 | GHDL_RUN_OPTS = --stop-time=1400ns 6 | -------------------------------------------------------------------------------- /examples/working/apps/dy/sample.txt: -------------------------------------------------------------------------------- 1 | < < 11 12 13 14 > < 21 22 23 24 > < 31 32 33 34 > > 2 | -------------------------------------------------------------------------------- /examples/working/apps/grad/lena64.pgm: -------------------------------------------------------------------------------- 1 | ../../../imgs/lena64.pgm -------------------------------------------------------------------------------- /examples/working/apps/grad/main.procs: -------------------------------------------------------------------------------- 1 | PRE_PROC = pgm2txt -abbrev lena64.pgm lena64.txt 2 | POST_PROC = txt2pgm -abbrev 255 sim/result.txt sim/result.pgm 3 | -------------------------------------------------------------------------------- /examples/working/apps/grad/main.proj: -------------------------------------------------------------------------------- 1 | DOT_OPTS = -D ifile=lena64.pgm -D arg2=40S -suppress_cast_warnings 2 | SIM_OPTS = -D ifile=lena64.pgm -D arg2=40S -suppress_cast_warnings -chan_cap 130 -abbrev_dc_ctors 3 | SC_OPTS = -D ifile=lena64.pgm -D arg2=40S -suppress_cast_warnings -sc_default_fifo_capacity 256 -sc_stop_time 200000 -sc_abbrev_dc_ctors -sc_dump_fifo_stats 4 | VHDL_OPTS = -D ifile=lena64.pgm -D arg2=40S -suppress_cast_warnings -vhdl_annot_file ./systemc/fifo_stats.dat 5 | GHDL_RUN_OPTS = --stop-time=400000ns 6 | 7 | grad_fifo_stats.dat: systemc.run 8 | -------------------------------------------------------------------------------- /examples/working/apps/histo/main.cph: -------------------------------------------------------------------------------- 1 | actor histo 2 | in (a:unsigned<1>) 3 | out (o:unsigned<4>) 4 | var h : unsigned<4> array[2] = [ 0 | i=0 to 1 ] 5 | rules 6 | | a:i -> (h[i]:h[i]+1, o:h[0]) 7 | ; 8 | 9 | stream i:unsigned<1> from "sample.txt"; 10 | stream o:unsigned<4> to "result.txt"; 11 | 12 | net o = histo i; 13 | -------------------------------------------------------------------------------- /examples/working/apps/histo/main.proj: -------------------------------------------------------------------------------- 1 | DOT_OPTS = 2 | SIM_OPTS = -abbrev_dc_ctors 3 | SC_OPTS = -sc_stop_time 600 -sc_abbrev_dc_ctors 4 | VHDL_OPTS = -vhdl_default_fifo_capacity 32 5 | GHDL_RUN_OPTS = --stop-time=600ns --wave=histo_tb.ghw 6 | -------------------------------------------------------------------------------- /examples/working/apps/histo/sample.txt: -------------------------------------------------------------------------------- 1 | 0 0 1 1 1 2 | -------------------------------------------------------------------------------- /examples/working/apps/histo2d/main.proj: -------------------------------------------------------------------------------- 1 | DOT_OPTS = 2 | SIM_OPTS = -abbrev_dc_ctors 3 | SC_OPTS = -sc_stop_time 1200 -sc_abbrev_dc_ctors 4 | VHDL_OPTS = -vhdl_default_fifo_capacity 32 5 | GHDL_RUN_OPTS = --stop-time=1200ns --wave=histo2d_tb.ghw 6 | 7 | sample.bin: ../sample.txt 8 | $(TXT2BIN) -dc -abbrev uint 8 $< > $@ 9 | 10 | show: 11 | @if [ ! -e "result.txt" ]; then \ 12 | $(BIN2TXT) -dc -abbrev uint 3 result.bin > result.txt; \ 13 | fi 14 | @/bin/echo -n "Result: "; cat result.txt 15 | @echo "" 16 | -------------------------------------------------------------------------------- /examples/working/apps/histo2d/sample.txt: -------------------------------------------------------------------------------- 1 | < 0 1 1 2 2 2 3 3 3 3 > < 0 1 1 2 2 2 3 3 3 3 > 2 | -------------------------------------------------------------------------------- /examples/working/apps/histof/main.proj: -------------------------------------------------------------------------------- 1 | DOT_OPTS = #-dump_fsms 2 | SIM_OPTS = -abbrev_dc_ctors 3 | SC_OPTS = -sc_stop_time 2800 -sc_abbrev_dc_ctors -sc_dump_fifo_stats 4 | VHDL_OPTS = -vhdl_annot_file ./systemc/fifo_stats.dat 5 | GHDL_RUN_OPTS = --stop-time=2800ns 6 | -------------------------------------------------------------------------------- /examples/working/apps/histof/sample.txt: -------------------------------------------------------------------------------- 1 | < < 1 2 2 4 4 4 4 8 8 8 8 8 8 8 8 15 > < 1 2 2 4 4 4 4 8 8 8 8 8 8 8 8 15 > < 1 2 2 4 4 4 4 8 8 8 8 8 8 8 8 15 > < 1 2 2 4 4 4 4 8 8 8 8 8 8 8 8 15 > > 2 | -------------------------------------------------------------------------------- /examples/working/apps/histol/main.proj: -------------------------------------------------------------------------------- 1 | DOT_OPTS = 2 | SIM_OPTS = -abbrev_dc_ctors 3 | SC_OPTS = -sc_stop_time 600 -sc_abbrev_dc_ctors 4 | VHDL_OPTS = -vhdl_default_fifo_capacity 32 5 | GHDL_RUN_OPTS = --stop-time=600ns --wave=histol_tb.ghw 6 | -------------------------------------------------------------------------------- /examples/working/apps/histol/sample.txt: -------------------------------------------------------------------------------- 1 | < 1 2 2 4 4 4 4 8 8 8 8 8 8 8 8 15 > 2 | -------------------------------------------------------------------------------- /examples/working/apps/hproj/main.cph: -------------------------------------------------------------------------------- 1 | #include "dc.cph" 2 | 3 | actor hproj () 4 | in (a:unsigned<8> dc) 5 | out (c:unsigned<16> dc) 6 | var s : unsigned<16> 7 | var st : {S0,S1,S2} = S0 8 | rules 9 | | (st:S0, a:'<) -> (c:'<, st:S1) 10 | | (st:S1, a:'>) -> (c:'>, st:S0) 11 | | (st:S1, a:'<) -> (s:0, st:S2) 12 | | (st:S2, a:'>) -> (c:'s, st:S1) 13 | | (st:S2, a:'v) -> (s:s+(v:unsigned<16>), st:S2) 14 | -- An explicit cast to unsigned<16> is required here since the "+" builtin operator 15 | -- has type int * int -> int (and _not_ : int * int -> int ... *) 16 | ; 17 | 18 | stream i:unsigned<8> dc from "img.txt"; 19 | stream o:unsigned<16> dc to "result.txt"; 20 | 21 | net o = hproj i; 22 | -------------------------------------------------------------------------------- /examples/working/apps/hproj/main.proj: -------------------------------------------------------------------------------- 1 | DOT_OPTS = 2 | SIM_OPTS = -abbrev_dc_ctors 3 | SC_OPTS = -sc_dump_fifo_stats -sc_stop_time 48000 -sc_abbrev_dc_ctors 4 | VHDL_OPTS = 5 | GHDL_RUN_OPTS = --stop-time=160000ns 6 | 7 | -------------------------------------------------------------------------------- /examples/working/apps/median13/main.proj: -------------------------------------------------------------------------------- 1 | DOT_OPTS = 2 | SIM_OPTS = -abbrev_dc_ctors 3 | SC_OPTS = -sc_stop_time 400 -sc_abbrev_dc_ctors 4 | VHDL_OPTS = 5 | GHDL_RUN_OPTS = --stop-time=600ns 6 | -------------------------------------------------------------------------------- /examples/working/apps/median13/sample.txt: -------------------------------------------------------------------------------- 1 | < 1 2 6 4 9 8 12 5 > 2 | -------------------------------------------------------------------------------- /examples/working/apps/rl/main.proj: -------------------------------------------------------------------------------- 1 | DOT_OPTS = -I .. 2 | SIM_OPTS = -I .. -abbrev_dc_ctors 3 | SC_OPTS = -I .. -sc_stop_time 400 -sc_abbrev_dc_ctors -sc_dump_fifo_stats 4 | VHDL_OPTS = -I .. -vhdl_annot_file ./systemc/fifo_stats.dat 5 | GHDL_RUN_OPTS = --stop-time=600ns 6 | -------------------------------------------------------------------------------- /examples/working/apps/rl/rl_type.cph: -------------------------------------------------------------------------------- 1 | type $t rl = -- [t rl] is the type of run lengths where [t] is type of the sequence elements 2 | RL of $t * unsigned; -- and [n] the number of bits used for coding the length 3 | 4 | -------------------------------------------------------------------------------- /examples/working/apps/rl/sample.txt: -------------------------------------------------------------------------------- 1 | 1 1 3 3 3 3 3 3 2 6 6 6 2 | -------------------------------------------------------------------------------- /examples/working/apps/rld/main.cph: -------------------------------------------------------------------------------- 1 | -- Run-length decoder 2 | -- RLD:RL(p1,k1),RL(p2,k2),...= p1,...,p1,p2,...,p2,... 3 | -- \--k1--/ \--k2--/ ... 4 | -- Initial version: Jun 12, 2010 - JS 5 | -- Revised : Aug 9, 2015 - JS 6 | 7 | #include "rld.cph" 8 | 9 | stream i:signed<8> rl<4> from "sample.txt"; 10 | stream o:signed<8> to "result.txt"; 11 | 12 | net o = rld 4 i; 13 | -------------------------------------------------------------------------------- /examples/working/apps/rld/main.proj: -------------------------------------------------------------------------------- 1 | DOT_OPTS = -I .. 2 | SIM_OPTS = -I .. 3 | SC_OPTS = -I .. -sc_stop_time 400 4 | VHDL_OPTS = -I .. -vhdl_io_converters 5 | GHDL_RUN_OPTS = --stop-time=400ns --vcd=rld_tb.vcd 6 | -------------------------------------------------------------------------------- /examples/working/apps/rld/rl_type.cph: -------------------------------------------------------------------------------- 1 | type $t rl = -- [t rl] is the type of run lengths where [t] is type of the sequence elements 2 | RL of $t * unsigned; -- and [n] the number of bits used for coding the length 3 | 4 | -------------------------------------------------------------------------------- /examples/working/apps/rld/rld.cph: -------------------------------------------------------------------------------- 1 | -- Run-length decoder 2 | -- RLD:RL(p1,k1),RL(p2,k2),...= p1,...,p1,p2,...,p2,... 3 | -- \--k1--/ \--k2--/ ... 4 | -- Initial version: Jun 12, 2010 - JS 5 | -- Revised : Aug 9, 2015 - JS 6 | 7 | #include "../rle/rl_type.cph" 8 | 9 | actor rld (n: int) 10 | in (i:$t rl) 11 | out (o:$t) 12 | var st : {WaitRun,WriteRun} = WaitRun 13 | var v : $t 14 | var k : unsigned = 0 15 | rules 16 | | (st:WaitRun, i:RL(p,m)) -> (st:WriteRun, o:p, v:p, k:m-1) 17 | | st:WriteRun when k=0 -> st:WaitRun 18 | | st:WriteRun -> (o:v, k:k-1) 19 | ; 20 | -------------------------------------------------------------------------------- /examples/working/apps/rld/sample.txt: -------------------------------------------------------------------------------- 1 | RL 10 4 RL 20 1 RL 30 10 2 | -------------------------------------------------------------------------------- /examples/working/apps/rle/main.cph: -------------------------------------------------------------------------------- 1 | #include "rle.cph" 2 | 3 | stream i:signed<8> from "sample.txt"; 4 | stream o:signed<8> rl<4> to "result.txt"; 5 | 6 | net o = rle 4 i; 7 | 8 | -------------------------------------------------------------------------------- /examples/working/apps/rle/main.proj: -------------------------------------------------------------------------------- 1 | DOT_OPTS = -dump_fsms 2 | SIM_OPTS = -I .. 3 | SC_OPTS = -I .. -sc_stop_time 400 4 | VHDL_OPTS = -I .. -vhdl_io_converters 5 | GHDL_RUN_OPTS = --stop-time=400ns 6 | -------------------------------------------------------------------------------- /examples/working/apps/rle/rl_type.cph: -------------------------------------------------------------------------------- 1 | type $t rl = -- [t rl] is the type of run lengths where [t] is type of the sequence elements 2 | RL of $t * unsigned; -- and [n] the number of bits used for coding the length 3 | 4 | -------------------------------------------------------------------------------- /examples/working/apps/rle/rle.cph: -------------------------------------------------------------------------------- 1 | -- Run-length encoder 2 | -- RLE:p1,...,p1,p2,...,p2,... = RL(p1,k1),RL(p2,k2),... 3 | -- \--k1--/ \--k2--/ ... 4 | -- Initial version: Jun 12, 2010 - JS 5 | -- Revised : Aug 4, 2015 - JS 6 | -- 7 | 8 | #include "rl_type.cph" 9 | 10 | actor rle (n: int) 11 | in (i:$t) 12 | out (o:$t rl) 13 | var st : {S0,S1} = S0 14 | var c : $t -- current symbol 15 | var k : unsigned -- length of current run 16 | rules 17 | | (st:S0, i:v) -> (st:S1, c:v, k:1) 18 | | (st:S1, i:v) when v=c -> (st:S1, k:k+1) 19 | | (st:S1, i:v) -> (st:S1, o:RL(c,k), c:v, k:1) 20 | ; 21 | -------------------------------------------------------------------------------- /examples/working/apps/rle/sample.txt: -------------------------------------------------------------------------------- 1 | 1 1 3 3 3 3 3 3 2 6 6 6 0 2 | -------------------------------------------------------------------------------- /examples/working/apps/transpose/main.proj: -------------------------------------------------------------------------------- 1 | DOT_OPTS = 2 | SIM_OPTS = -abbrev_dc_ctors 3 | SC_OPTS = -sc_stop_time 800 -sc_abbrev_dc_ctors -sc_dump_fifo_stats 4 | VHDL_OPTS = -vhdl_istream_period 1 -vhdl_annot_file ./systemc/fifo_stats.dat # -vhdl_default_fifo_capacity 32 5 | GHDL_RUN_OPTS = --stop-time=800ns --wave=transpose_tb.ghw 6 | -------------------------------------------------------------------------------- /examples/working/apps/transpose/sample.txt: -------------------------------------------------------------------------------- 1 | < 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 > 2 | -------------------------------------------------------------------------------- /examples/working/apps/vproj/main.proj: -------------------------------------------------------------------------------- 1 | DOT_OPTS = -suppress_cast_warnings 2 | SIM_OPTS = -suppress_cast_warnings -abbrev_dc_ctors 3 | SC_OPTS = -suppress_cast_warnings -sc_dump_fifo_stats -sc_stop_time 48000 -sc_abbrev_dc_ctors 4 | VHDL_OPTS = -suppress_cast_warnings 5 | GHDL_RUN_OPTS = --stop-time=160000ns 6 | -------------------------------------------------------------------------------- /examples/working/basic/bitop/main.cph: -------------------------------------------------------------------------------- 1 | -- A simple actor showing bitwise operations 2 | 3 | actor bit 4 | in(a:unsigned<8>) 5 | out(c:unsigned<8>) 6 | rules 7 | | a: v -> c: v land (v lor lnot v) 8 | ; 9 | 10 | stream i:unsigned<8> from "sample.txt"; 11 | stream o:unsigned<8>to "result.txt"; 12 | 13 | net o = bit i; 14 | -------------------------------------------------------------------------------- /examples/working/basic/bitop/main.proj: -------------------------------------------------------------------------------- 1 | SIM_OPTS = -abbrev_dc_ctors 2 | SC_OPTS = -sc_stop_time 100 -sc_abbrev_dc_ctors 3 | VHDL_OPTS = 4 | GHDL_RUN_OPTS = --stop-time=300ns 5 | -------------------------------------------------------------------------------- /examples/working/basic/bitop/sample.txt: -------------------------------------------------------------------------------- 1 | 1 2 3 4 2 | -------------------------------------------------------------------------------- /examples/working/basic/cmp/main.cph: -------------------------------------------------------------------------------- 1 | -- Parameterized comparator 2 | -- CMP[k] : < .. xi ... > = < ... f(xi) ... > where f(x)=true if x=k, false otherwise 3 | -- Shows the use of the [bool] type 4 | 5 | #include "dc.cph" 6 | 7 | actor cmp (k:$t) 8 | in (a:$t dc) 9 | out (c:bool dc) 10 | rules a -> c 11 | | '< -> '< 12 | | '> -> '> 13 | | 'p -> '(p=k) 14 | ; 15 | 16 | stream i:unsigned<8> dc from "sample.txt"; 17 | stream o:bool dc to "result.txt"; 18 | 19 | net o = cmp 10 i; 20 | -------------------------------------------------------------------------------- /examples/working/basic/cmp/main.proj: -------------------------------------------------------------------------------- 1 | DOT_OPTS = 2 | SIM_OPTS = -abbrev_dc_ctors 3 | SC_OPTS = -sc_stop_time 100 -sc_abbrev_dc_ctors 4 | VHDL_OPTS = 5 | GHDL_RUN_OPTS = --stop-time=300ns 6 | -------------------------------------------------------------------------------- /examples/working/basic/cmp/sample.txt: -------------------------------------------------------------------------------- 1 | < 10 20 30 40 80 10 > 2 | -------------------------------------------------------------------------------- /examples/working/basic/cmps/main.cph: -------------------------------------------------------------------------------- 1 | -- cmps[k]() = true iff p_i=k for all i=1..n 2 | -- 2012-11-03, JS 3 | 4 | #include "dc.cph" 5 | 6 | actor cmps (k:$t) 7 | in (a:$t dc) 8 | out (c:bool) 9 | var t : bool 10 | rules 11 | | a:'< -> t:true 12 | | a:'> -> c:t 13 | | a:'p -> t:t && p=k 14 | ; 15 | 16 | stream i:unsigned<8> dc from "sample.txt"; 17 | stream o:bool to "result.txt"; 18 | 19 | net o = cmps 1 i; 20 | -------------------------------------------------------------------------------- /examples/working/basic/cmps/main.proj: -------------------------------------------------------------------------------- 1 | DOT_OPTS = 2 | SIM_OPTS = -abbrev_dc_ctors 3 | SC_OPTS = -sc_stop_time 400 -sc_abbrev_dc_ctors # 4 | VHDL_OPTS = 5 | GHDL_RUN_OPTS = --stop-time=800ns 6 | -------------------------------------------------------------------------------- /examples/working/basic/cmps/sample.txt: -------------------------------------------------------------------------------- 1 | < 1 2 1 1 > < 1 1 1 1 1 1 > < 1 1 0 1 1 0 1 > 2 | -------------------------------------------------------------------------------- /examples/working/basic/globals/main.cph: -------------------------------------------------------------------------------- 1 | -- This example illustrates the use of global functions and constants 2 | 3 | #include "dc.cph" 4 | 5 | function mult (x,y)= x*y : signed * signed -> signed; 6 | 7 | const z = 2 : signed<8>; 8 | 9 | actor scale (k:signed) 10 | in (a:signed dc) 11 | out (c:signed dc) 12 | rules a -> c 13 | | '< -> '< 14 | | 'p -> '(mult(p,k)) 15 | | '> -> '>; 16 | 17 | stream i:signed<8> dc from "sample.txt"; 18 | stream o:signed<8> dc to "result.txt"; 19 | 20 | net o = scale z i ; 21 | -------------------------------------------------------------------------------- /examples/working/basic/globals/main.proj: -------------------------------------------------------------------------------- 1 | DOT_OPTS = -suppress_cast_warnings 2 | SIM_OPTS = -abbrev_dc_ctors -suppress_cast_warnings 3 | SC_OPTS = -sc_stop_time 100 -sc_abbrev_dc_ctors -suppress_cast_warnings 4 | VHDL_OPTS = -suppress_cast_warnings 5 | GHDL_RUN_OPTS = --stop-time=200ns 6 | -------------------------------------------------------------------------------- /examples/working/basic/globals/sample.txt: -------------------------------------------------------------------------------- 1 | < 1 2 3 4 > 2 | -------------------------------------------------------------------------------- /examples/working/basic/let/main.cph: -------------------------------------------------------------------------------- 1 | -- This example shows how to use the "let ... in" construct to break computations in smaller parts 2 | -- (and also to share results of a computation) 3 | 4 | -- Expected input: 1 3 6 10 5 5 | -- Expected output: 6 42 156 420 110 6 | 7 | actor foo () 8 | in (a:signed<10>) 9 | out (c:signed<10>) 10 | rules a -> c 11 | | v -> let x = (v*2:signed<10>) in let y = x+1 in (x*y:signed<10>) 12 | ; 13 | 14 | stream i:signed<10> from "sample.txt"; 15 | stream o:signed<10> to "result.txt"; 16 | 17 | net o = foo i; 18 | -------------------------------------------------------------------------------- /examples/working/basic/let/main.proj: -------------------------------------------------------------------------------- 1 | SIM_OPTS = -abbrev_dc_ctors 2 | SC_OPTS = -sc_stop_time 100 -sc_abbrev_dc_ctors 3 | VHDL_OPTS = 4 | GHDL_RUN_OPTS = --stop-time=200ns 5 | -------------------------------------------------------------------------------- /examples/working/basic/let/sample.txt: -------------------------------------------------------------------------------- 1 | 1 3 6 10 5 2 | -------------------------------------------------------------------------------- /examples/working/basic/lut1/main.cph: -------------------------------------------------------------------------------- 1 | -- Simple (fixed) Look Up Table 2 | -- 2011-10-07, JS 3 | 4 | actor lut () 5 | in (a:unsigned<4>) 6 | out (c:unsigned<8>) 7 | var mem : unsigned<8> array[8] = [ 0, 10, 20, 30, 40, 50, 60, 70 ] 8 | rules 9 | | a:i -> c:mem[i] 10 | ; 11 | 12 | stream i:unsigned<4> from "sample.txt"; 13 | stream o:unsigned<8> to "result.txt"; 14 | 15 | net o = lut i; 16 | -------------------------------------------------------------------------------- /examples/working/basic/lut1/main.proj: -------------------------------------------------------------------------------- 1 | SIM_OPTS = -abbrev_dc_ctors 2 | SC_OPTS = -sc_stop_time 800 -sc_abbrev_dc_ctors 3 | VHDL_OPTS = 4 | GHDL_RUN_OPTS = --stop-time=1400ns 5 | -------------------------------------------------------------------------------- /examples/working/basic/lut1/sample.txt: -------------------------------------------------------------------------------- 1 | 0 1 2 3 4 5 6 7 2 | -------------------------------------------------------------------------------- /examples/working/basic/lut2/main.cph: -------------------------------------------------------------------------------- 1 | -- Programmable Look Up Table 2 | -- 2013-04-23, JS 3 | 4 | actor lut (mem: unsigned<8> array[8]) 5 | in (a:unsigned<4>) 6 | out (c:unsigned<8>) 7 | rules 8 | | a:i -> c:mem[i] 9 | ; 10 | 11 | stream i:unsigned<4> from "sample.txt"; 12 | stream o:unsigned<8> to "result.txt"; 13 | 14 | net o = lut [0,10,20,30,40,50,60,70] i; 15 | -------------------------------------------------------------------------------- /examples/working/basic/lut2/main.proj: -------------------------------------------------------------------------------- 1 | SIM_OPTS = -abbrev_dc_ctors 2 | SC_OPTS = -sc_stop_time 800 -sc_abbrev_dc_ctors 3 | VHDL_OPTS = 4 | GHDL_RUN_OPTS = --stop-time=1400ns 5 | -------------------------------------------------------------------------------- /examples/working/basic/lut2/sample.txt: -------------------------------------------------------------------------------- 1 | 0 1 2 3 4 5 6 7 2 | -------------------------------------------------------------------------------- /examples/working/basic/lut3/main.cph: -------------------------------------------------------------------------------- 1 | -- 2D (actually 1Dx1D) LookUp Table 2 | 3 | actor lut2 () 4 | in (a:unsigned<4>, b:unsigned<4>) 5 | out (c:unsigned<8>) 6 | var mem : unsigned<8> array[4][4] = [ [ 11, 12, 13, 14 ], 7 | [ 21, 22, 23, 24 ], 8 | [ 31, 32, 33, 34 ], 9 | [ 41, 42, 43, 44 ] ] 10 | rules (a,b) -> c 11 | | (i,j) -> mem[i][j] 12 | ; 13 | 14 | stream i:unsigned<4> from "sample.txt"; 15 | stream o:unsigned<8> to "result.txt"; 16 | 17 | net o = lut2 (i,i); 18 | -------------------------------------------------------------------------------- /examples/working/basic/lut3/main.proj: -------------------------------------------------------------------------------- 1 | SIM_OPTS = -abbrev_dc_ctors 2 | SC_OPTS = -sc_stop_time 800 -sc_abbrev_dc_ctors 3 | VHDL_OPTS = 4 | GHDL_RUN_OPTS = --stop-time=1400ns 5 | -------------------------------------------------------------------------------- /examples/working/basic/lut3/sample.txt: -------------------------------------------------------------------------------- 1 | 0 1 2 3 2 | -------------------------------------------------------------------------------- /examples/working/basic/lut4/main.cph: -------------------------------------------------------------------------------- 1 | -- 3D (actually 1Dx1Dx1D) LookUp Table 2 | 3 | actor lut 4 | in (a:unsigned<4>, b:unsigned<4>, c:unsigned<4>) 5 | out (o:unsigned<8>) 6 | var mem : unsigned<8> array[2][3][4] = [ 7 | [ [ 11, 12, 13, 14 ], 8 | [ 21, 22, 23, 24 ], 9 | [ 31, 32, 33, 34 ] ], 10 | [ [ 15, 16, 17, 18 ], 11 | [ 25, 26, 27, 28 ], 12 | [ 35, 36, 37, 38 ] ] 13 | ] 14 | rules (a,b,c) -> o 15 | | (i,j,k) -> mem[i mod 2][j mod 3][k mod 4] 16 | ; 17 | 18 | stream i:unsigned<4> from "sample.txt"; 19 | stream o:unsigned<8> to "result.txt"; 20 | 21 | net o = lut (i,i,i); 22 | -------------------------------------------------------------------------------- /examples/working/basic/lut4/main.proj: -------------------------------------------------------------------------------- 1 | SIM_OPTS = -abbrev_dc_ctors 2 | SC_OPTS = -sc_stop_time 800 -sc_abbrev_dc_ctors 3 | VHDL_OPTS = 4 | GHDL_RUN_OPTS = --stop-time=1400ns 5 | -------------------------------------------------------------------------------- /examples/working/basic/lut4/sample.txt: -------------------------------------------------------------------------------- 1 | 0 1 2 3 2 | -------------------------------------------------------------------------------- /examples/working/basic/mux/main.cph: -------------------------------------------------------------------------------- 1 | actor mux 2 | in (e1:$t, e2:$t, c:bool) 3 | out (s:$t) 4 | rules 5 | | (e1:x,c:true) -> s:x 6 | | (e2:x,c:false) -> s:x 7 | ; 8 | 9 | stream i1:signed<8> from "sample1.txt"; 10 | stream i2:signed<8> from "sample2.txt"; 11 | stream i3:bool from "sample3.txt"; 12 | stream o1:signed<8> to "result1.txt"; 13 | 14 | net o1 = mux (i1,i2,i3) ; 15 | -------------------------------------------------------------------------------- /examples/working/basic/mux/main.proj: -------------------------------------------------------------------------------- 1 | SIM_OPTS = -abbrev_dc_ctors 2 | SC_OPTS = -sc_stop_time 800 -sc_abbrev_dc_ctors -sc_dump_fifo_stats 3 | VHDL_OPTS = -vhdl_annot_file mux_fifo_stats.dat 4 | GHDL_RUN_OPTS = --stop-time=200ns 5 | -------------------------------------------------------------------------------- /examples/working/basic/mux/sample1.txt: -------------------------------------------------------------------------------- 1 | 1 3 5 7 9 2 | -------------------------------------------------------------------------------- /examples/working/basic/mux/sample2.txt: -------------------------------------------------------------------------------- 1 | 2 4 6 8 10 2 | -------------------------------------------------------------------------------- /examples/working/basic/mux/sample3.txt: -------------------------------------------------------------------------------- 1 | true false true false true 2 | -------------------------------------------------------------------------------- /examples/working/basic/scale/main.cph: -------------------------------------------------------------------------------- 1 | #include "dc.cph" 2 | 3 | actor scale (k:unsigned<8>) 4 | in (a:unsigned<8> dc) 5 | out (c:unsigned<8> dc) 6 | rules a -> c 7 | | '< -> '< 8 | | 'p -> 'p*k 9 | | '> -> '> 10 | ; 11 | 12 | stream i:unsigned<8> dc from "sample.txt"; 13 | stream o:unsigned<8> dc to "result.txt"; 14 | 15 | net o = scale 2 i; 16 | 17 | -------------------------------------------------------------------------------- /examples/working/basic/scale/main.proj: -------------------------------------------------------------------------------- 1 | DOT_OPTS = # -infer_mocs -dump_senv 2 | SIM_OPTS = -abbrev_dc_ctors 3 | SC_OPTS = -sc_abbrev_dc_ctors -sc_io_monitor -sc_stop_when_idle 100 -sc_dump_fifo_stats 4 | VHDL_OPTS = 5 | GHDL_RUN_OPTS = --stop-time=300ns --vcd=scale_tb.vcd 6 | -------------------------------------------------------------------------------- /examples/working/basic/scale/sample.txt: -------------------------------------------------------------------------------- 1 | < 10 20 30 40 80 > 2 | -------------------------------------------------------------------------------- /examples/working/basic/scale2/main.cph: -------------------------------------------------------------------------------- 1 | #include "dc.cph" 2 | 3 | actor scale (k:signed<8>) 4 | in (a:signed<8> dc) 5 | out (c:signed<8> dc) 6 | rules a -> c 7 | | '< -> '< 8 | | 'p -> 'p*k 9 | | '> -> '> 10 | ; 11 | 12 | stream i:signed<8> dc from "sample.txt"; 13 | stream o:signed<8> dc to "result.txt"; 14 | 15 | net o = scale 3 (scale 2 i); 16 | -------------------------------------------------------------------------------- /examples/working/basic/scale2/main.proj: -------------------------------------------------------------------------------- 1 | DOT_OPTS = -dump_senv 2 | SIM_OPTS = -abbrev_dc_ctors -dump_fsms 3 | SC_OPTS = -sc_stop_time 400 -sc_abbrev_dc_ctors 4 | VHDL_OPTS = 5 | GHDL_RUN_OPTS = --stop-time=200ns 6 | -------------------------------------------------------------------------------- /examples/working/basic/scale2/sample.txt: -------------------------------------------------------------------------------- 1 | < 1 2 3 4 > 2 | -------------------------------------------------------------------------------- /examples/working/basic/simple/Readme: -------------------------------------------------------------------------------- 1 | The simplest possible example : the identity actor reading and writting unstructured streams 2 | -------------------------------------------------------------------------------- /examples/working/basic/simple/main.cph: -------------------------------------------------------------------------------- 1 | actor id () 2 | in (a:unsigned<8>) 3 | out (c:unsigned<8>) 4 | rules 5 | | a:v -> c:v 6 | ; 7 | 8 | stream i:unsigned<8> from "sample.txt"; 9 | stream o:unsigned<8> to "result.txt"; 10 | 11 | net o = id i; 12 | 13 | -------------------------------------------------------------------------------- /examples/working/basic/simple/main.proj: -------------------------------------------------------------------------------- 1 | SIM_OPTS = 2 | SC_OPTS = -sc_stop_time 200 3 | VHDL_OPTS = 4 | GHDL_RUN_OPTS = --stop-time=200ns 5 | -------------------------------------------------------------------------------- /examples/working/basic/simple/sample.txt: -------------------------------------------------------------------------------- 1 | 1 2 3 4 5 6 2 | -------------------------------------------------------------------------------- /examples/working/basic/thr1/main.cph: -------------------------------------------------------------------------------- 1 | #include "dc.cph" 2 | 3 | actor thr (k:unsigned<8>) 4 | in (a:unsigned<8> dc) 5 | out (c:unsigned<1> dc) 6 | rules a -> c 7 | | '< -> '< 8 | | 'p -> if p > k then '1 else '0 9 | | '> -> '> 10 | ; 11 | 12 | stream i:unsigned<8> dc from "sample.txt"; 13 | stream o:unsigned<1> dc to "result.txt"; 14 | 15 | net o = thr 2 i; 16 | 17 | -------------------------------------------------------------------------------- /examples/working/basic/thr1/main.proj: -------------------------------------------------------------------------------- 1 | DOT_OPTS = 2 | SIM_OPTS = -abbrev_dc_ctors 3 | SC_OPTS = -sc_stop_time 100 -sc_abbrev_dc_ctors 4 | VHDL_OPTS = 5 | GHDL_RUN_OPTS = --stop-time=200ns 6 | -------------------------------------------------------------------------------- /examples/working/basic/thr1/sample.txt: -------------------------------------------------------------------------------- 1 | < 1 3 2 4 > 2 | -------------------------------------------------------------------------------- /examples/working/basic/thr2/main.cph: -------------------------------------------------------------------------------- 1 | -- Another formulation of the [thr] actor using guarded rules 2 | 3 | #include "dc.cph" 4 | 5 | actor thr (k:signed<8>) 6 | in (a:signed<8> dc) 7 | out (c:unsigned<1> dc) 8 | rules a -> c 9 | | '< -> '< 10 | | 'p when p > k -> '1 11 | | 'p -> '0 12 | | '> -> '> 13 | ; 14 | 15 | stream i:signed<8> dc from "sample.txt"; 16 | stream o:unsigned<1> dc to "result.txt"; 17 | 18 | net o = thr 2 i; 19 | 20 | -------------------------------------------------------------------------------- /examples/working/basic/thr2/main.proj: -------------------------------------------------------------------------------- 1 | DOT_OPTS = 2 | SIM_OPTS = -abbrev_dc_ctors 3 | SC_OPTS = -sc_stop_time 100 -sc_abbrev_dc_ctors 4 | VHDL_OPTS = 5 | GHDL_RUN_OPTS = --stop-time=200ns 6 | -------------------------------------------------------------------------------- /examples/working/basic/thr2/sample.txt: -------------------------------------------------------------------------------- 1 | < 1 3 2 4 > 2 | -------------------------------------------------------------------------------- /examples/working/cal/suml/main.cph: -------------------------------------------------------------------------------- 1 | -- This is a CAL-friendly reformulation of the example [../misc/suml] 2 | -- The type [unsigned dc] is implemented as [unsigned] with the 2 MSBs acting as delimiters : 3 | -- '< (start of list) is encoded as 01 000...000 4 | -- '> (end od list) is encoded as 10 000...000 5 | -- 'v (data) is encoded as 00 xxx...xxx 6 | -- Jul 20, 2017 - JS 7 | 8 | actor suml (n: unsigned<8>) 9 | in (a:unsigned) 10 | out (c:unsigned) 11 | var st : {S0,S1} = S0 12 | var s : unsigned 13 | rules 14 | | (st:S0, a:x) when x land (1 << (n-2)) != 0 -> (st:S1, s:0) -- Start of list 15 | | (st:S1, a:x) when x land (1 << (n-1)) != 0 -> (st:S0, c:s) -- End of list 16 | | (st:S1, a:x) -> s:s+x 17 | ; 18 | 19 | stream i:unsigned<10> from "sample.txt"; 20 | stream o:unsigned<10> to "result.txt"; 21 | 22 | net o = suml 10 i; 23 | -------------------------------------------------------------------------------- /examples/working/cal/suml/main.proj: -------------------------------------------------------------------------------- 1 | DOT_OPTS = 2 | SIM_OPTS = 3 | SC_OPTS = -sc_stop_time 200 -sc_abbrev_dc_ctors -sc_dump_fifo_stats 4 | VHDL_OPTS = 5 | XDF_OPTS = -xdf_package mypack 6 | GHDL_RUN_OPTS = --stop-time=300ns --wave=main_tb.ghw 7 | -------------------------------------------------------------------------------- /examples/working/cal/suml/sample.txt: -------------------------------------------------------------------------------- 1 | 256 1 2 3 512 256 1 2 3 4 512 2 | -------------------------------------------------------------------------------- /examples/working/conv/conv13_v1/main.cph: -------------------------------------------------------------------------------- 1 | -- 1D 1x3 convolution - with explicit neighborhood generation 2 | 3 | #include "neigh.cph" 4 | 5 | actor maddn (k:int array[3], m:int) 6 | in (a:int dc, b:int dc, c:int dc) 7 | out (s:int dc) 8 | rules (a,b,c) -> s 9 | | ( '<, '<, '<) -> '< 10 | | ('zzp, 'zp, 'p) -> '(k[2]*zzp+k[1]*zp+k[0]*p)>>m 11 | | ( '>, '>, '>) -> '> 12 | ; 13 | 14 | stream x1:unsigned<8> dc from "sample1.txt"; 15 | --stream x2:signed<10> dc from "sample2.txt"; 16 | stream r1:unsigned<8> dc to "result1.txt"; 17 | --stream r2:signed<10> dc to "result2.txt"; 18 | 19 | net r1 = maddn([1,2,1],2) (neigh13 0 x1); 20 | --net r2 = maddn([-1,2,-1],0) (neigh13 0 x2); 21 | -------------------------------------------------------------------------------- /examples/working/conv/conv13_v1/main.proj: -------------------------------------------------------------------------------- 1 | DOT_OPTS = 2 | SIM_OPTS = -abbrev_dc_ctors 3 | SC_OPTS = -sc_stop_time 400 -sc_abbrev_dc_ctors -sc_dump_fifo_stats 4 | VHDL_OPTS = -vhdl_annot_file ./systemc/fifo_stats.dat 5 | GHDL_RUN_OPTS = --stop-time=600ns 6 | -------------------------------------------------------------------------------- /examples/working/conv/conv13_v1/sample1.txt: -------------------------------------------------------------------------------- 1 | < 1 2 3 4 5 6 7 8 > 2 | -------------------------------------------------------------------------------- /examples/working/conv/conv13_v1/sample2.txt: -------------------------------------------------------------------------------- 1 | < 1 2 3 4 5 6 7 8 > 2 | -------------------------------------------------------------------------------- /examples/working/conv/conv13_v2/main.cph: -------------------------------------------------------------------------------- 1 | -- 1D 1x3 convolution - mono-actor version 2 | 3 | #include "convol.cph" 4 | 5 | stream x1:unsigned<10> dc from "sample1.txt"; 6 | stream r1:unsigned<10> dc to "result1.txt"; 7 | stream x2:signed<8> dc from "sample2.txt"; 8 | stream r2:signed<8> dc to "result2.txt"; 9 | 10 | net r1 = conv113 ([1,2,1],2,0) x1; 11 | net r2 = conv113 ([-1,2,-1],0,0) x2; 12 | -------------------------------------------------------------------------------- /examples/working/conv/conv13_v2/main.proj: -------------------------------------------------------------------------------- 1 | DOT_OPTS = 2 | SIM_OPTS = -abbrev_dc_ctors 3 | SC_OPTS = -sc_stop_time 400 -sc_abbrev_dc_ctors 4 | VHDL_OPTS = 5 | GHDL_RUN_OPTS = --stop-time=600ns 6 | -------------------------------------------------------------------------------- /examples/working/conv/conv13_v2/sample1.txt: -------------------------------------------------------------------------------- 1 | < 1 2 3 4 5 6 7 8 > 2 | -------------------------------------------------------------------------------- /examples/working/conv/conv13_v2/sample2.txt: -------------------------------------------------------------------------------- 1 | < 1 2 3 4 5 6 7 8 > 2 | -------------------------------------------------------------------------------- /examples/working/conv/conv33_v1/main.procs: -------------------------------------------------------------------------------- 1 | PRE_PROC = pgm2txt -abbrev lena64.pgm lena64.txt 2 | POST_PROC = txt2pgm -abbrev 255 sim/result1.txt sim/result1.pgm 3 | POST_PROC = txt2pgm -abbrev 255 sim/result2.txt sim/result2.pgm 4 | -------------------------------------------------------------------------------- /examples/working/conv/conv33_v1/main.proj: -------------------------------------------------------------------------------- 1 | DOT_OPTS = -D ifile=lena64.pgm 2 | SIM_OPTS = -chan_cap 68 -D ifile=lena64.pgm -abbrev_dc_ctors 3 | SC_OPTS = -sc_default_fifo_capacity 130 -sc_stop_time 200000 -sc_dump_fifo_stats -D ifile=lena64.pgm -sc_abbrev_dc_ctors 4 | VHDL_OPTS = -vhdl_annot_file ./systemc/fifo_stats.dat -D ifile=lena64.pgm 5 | GHDL_RUN_OPTS = --stop-time=100000ns 6 | -------------------------------------------------------------------------------- /examples/working/conv/conv33_v1/sample.txt: -------------------------------------------------------------------------------- 1 | < < 11 12 13 14 15 > < 21 22 23 24 25 > < 31 32 33 34 35 > < 41 42 43 44 45 > < 51 52 53 54 55 > > 2 | -------------------------------------------------------------------------------- /examples/working/conv/conv33_v2/main.cph: -------------------------------------------------------------------------------- 1 | -- 2D 3x3 convolution implemented as a single actor 2 | 3 | #include "convol.cph" 4 | 5 | actor abs 6 | in (a:signed dc) 7 | out (c:signed dc) 8 | rules a -> c 9 | | '< -> '< 10 | | '> -> '> 11 | | 'x when x<0 -> '-x 12 | | 'x -> 'x 13 | ; 14 | 15 | stream x:signed<16> dc from %ifile; 16 | stream r1:signed<16> dc to "result1.txt"; 17 | stream r2:signed<16> dc to "result2.txt"; 18 | 19 | net r1 = conv233 ([[1,2,1],[2,4,2],[1,2,1]],4,0) x; -- Gaussian smoothing 20 | net r2 = abs (conv233 ([[0,-1,0],[-1,4,-1],[0,-1,0]],0,0) x); -- Laplace filtering 21 | -------------------------------------------------------------------------------- /examples/working/conv/conv33_v2/main.procs: -------------------------------------------------------------------------------- 1 | PRE_PROC = pgm2txt -abbrev lena64.pgm lena64.txt 2 | PRE_PROC = pgm2txt -abbrev lena128.pgm lena128.txt 3 | POST_PROC = txt2pgm -abbrev 255 sim/result1.txt sim/result1.pgm 4 | POST_PROC = txt2pgm -abbrev 255 sim/result2.txt sim/result2.pgm 5 | -------------------------------------------------------------------------------- /examples/working/conv/conv33_v2/main.proj: -------------------------------------------------------------------------------- 1 | DOT_OPTS = -D ifile=lena64.pgm 2 | SIM_OPTS = -chan_cap 68 -D ifile=lena64.pgm -abbrev_dc_ctors 3 | SC_OPTS = -sc_default_fifo_capacity 130 -sc_stop_time 800000 -sc_dump_fifo_stats -D ifile=lena64.pgm -sc_abbrev_dc_ctors 4 | VHDL_OPTS = -vhdl_annot_file ./systemc/fifo_stats.dat -D ifile=lena64.pgm 5 | GHDL_RUN_OPTS = --stop-time=400000ns 6 | 7 | -------------------------------------------------------------------------------- /examples/working/conv/conv33_v3/lena128.pgm: -------------------------------------------------------------------------------- 1 | ../../../imgs/lena128.pgm -------------------------------------------------------------------------------- /examples/working/conv/conv33_v3/main.cph: -------------------------------------------------------------------------------- 1 | -- 2D 3x3 _centered_ convolution implemented as a single actor 2 | 3 | #include "convol.cph" 4 | 5 | stream i: signed<16> dc from %ifile; 6 | stream o: signed<16> dc to "result.pgm"; 7 | 8 | net o = cconv233 ([[1,2,1], 9 | [2,4,2], 10 | [1,2,1]],4,0) i; 11 | -------------------------------------------------------------------------------- /examples/working/conv/conv33_v3/main.procs: -------------------------------------------------------------------------------- 1 | PRE_PROC = pgm2txt -abbrev lena128.pgm lena128.txt 2 | POST_PROC = txt2pgm -abbrev 255 sim/result.txt sim/result.pgm 3 | -------------------------------------------------------------------------------- /examples/working/conv/conv33_v3/main.proj: -------------------------------------------------------------------------------- 1 | # WARNING !!!! HORIZONTAL AND VERTICAL BLANKING REQUIRED HERE for the [CCONV] ACTORS !!! 2 | # 3 | DOT_OPTS = -D ifile=lena128.pgm 4 | SIM_OPTS = -chan_cap 140 -D ifile=lena128.pgm -abbrev_dc_ctors 5 | SC_OPTS = -sc_default_fifo_capacity 140 -sc_stop_time 240000 -sc_dump_fifo_stats -D ifile=lena128.pgm -sc_abbrev_dc_ctors -sc_istream_hblank 4 -sc_istream_vblank 140 6 | VHDL_OPTS = -vhdl_annot_file ./systemc/fifo_stats.dat -D ifile=lena128.pgm -vhdl_istream_blanking 7 | GHDL_RUN_OPTS = --stop-time=400000ns 8 | -------------------------------------------------------------------------------- /examples/working/conv/conv33_v3/main.rules: -------------------------------------------------------------------------------- 1 | lena128.bin: ../lena128.pgm 2 | $(PGM2BIN) -hblank 4 -vblank 140 16 $< $@ 3 | -------------------------------------------------------------------------------- /examples/working/conv/conv_bank/main.cph: -------------------------------------------------------------------------------- 1 | #include "convol.cph" 2 | 3 | function f_abs x = if x < 0 then -x else x : signed<12> -> signed<12>; 4 | 5 | const kernels = [ 6 | -- Each convolution kernel is a 2D (1Dx1D) array ... 7 | -- ... so what we define here is a 3D (1Dx1Dx1D) array 8 | [[0,1,0],[1,2,1],[0,1,0]], -- Kernel 1 9 | [[0,-1,0],[-1,4,-1],[0,-1,0]] -- Kernel 2 10 | ] : signed<12> array[2][3][3]; 11 | 12 | stream i:signed<12> dc from "lena64.txt"; 13 | stream o1:signed<12> dc to "result1.txt"; 14 | stream o2:signed<12> dc to "result2.txt"; 15 | 16 | net o1 = conv233 ((kernels[0]),3,0) i; 17 | net o2 = conv233 ((kernels[1]),0,0) i; 18 | 19 | -------------------------------------------------------------------------------- /examples/working/conv/conv_bank/main.proj: -------------------------------------------------------------------------------- 1 | SIM_OPTS = -abbrev_dc_ctors -chan_cap 128 2 | SC_OPTS = -sc_stop_time 200000 -sc_abbrev_dc_ctors -sc_default_fifo_capacity 128 -sc_dump_fifo_stats 3 | VHDL_OPTS = -vhdl_annot_file ./systemc/fifo_stats.dat 4 | GHDL_RUN_OPTS = --stop-time=100000ns 5 | -------------------------------------------------------------------------------- /examples/working/conv/mkconv1/lena128.pgm: -------------------------------------------------------------------------------- 1 | ../../../imgs/lena128.pgm -------------------------------------------------------------------------------- /examples/working/conv/mkconv1/main.cph: -------------------------------------------------------------------------------- 1 | -- This example shows how to use automatically generated convolution actors 2 | -- Feb 19, 2016 - JS 3 | 4 | #include "conv233.cph" -- This file will be automatically generated 5 | #include "conv255.cph" -- This file will be automatically generated 6 | 7 | stream i:signed<24> dc from "lena128.pgm"; 8 | stream o1:signed<24> dc to "result1.pgm"; 9 | stream o2:signed<24> dc to "result2.pgm"; 10 | 11 | net o1 = cconv233 ([[1,2,1], 12 | [2,4,2], 13 | [1,2,1]],4,0) i; 14 | net o2 = cconv255 ([[1,4,6,4,1], 15 | [4,16,24,16,4], 16 | [6,24,36,24,6], 17 | [4,16,24,16,4], 18 | [1,4,6,4,1]],8,0) i; 19 | -------------------------------------------------------------------------------- /examples/working/conv/mkconv1/main.procs: -------------------------------------------------------------------------------- 1 | PRE_PROC = pgm2txt -abbrev lena128.pgm lena128.txt 2 | PRE_PROC = mkconv -o conv233.cph -mode centered -dim 2 -h 3 -w 3 3 | PRE_PROC = mkconv -o conv255.cph -mode centered -dim 2 -h 5 -w 5 4 | POST_PROC = txt2pgm -abbrev 255 sim/result1.txt sim/result1.pgm 5 | POST_PROC = txt2pgm -abbrev 255 sim/result2.txt sim/result2.pgm 6 | -------------------------------------------------------------------------------- /examples/working/conv/mkconv1/main.proj: -------------------------------------------------------------------------------- 1 | # WARNING !!!! HORIZONTAL AND VERTICAL BLANKING REQUIRED HERE for the [CCONV] ACTORS !!! 2 | # 3 | DOT_OPTS = -I .. 4 | SIM_OPTS = -I .. -abbrev_dc_ctors -chan_cap 150 5 | SC_OPTS = -I .. -sc_abbrev_dc_ctors -sc_default_fifo_capacity 150 -sc_stop_time 800000 -sc_dump_fifo_stats -sc_istream_hblank 4 -sc_istream_vblank 140 6 | VHDL_OPTS = -I .. -vhdl_annot_file ./systemc/fifo_stats.dat -vhdl_istream_blanking 7 | GHDL_RUN_OPTS = --stop-time=640000ns 8 | 9 | 10 | GEN_CAPH_SRCS = conv233.cph conv255.cph 11 | conv233.cph: 12 | $(MKCONV) -o conv233.cph -mode centered -dim 2 -h 3 -w 3 13 | conv255.cph: 14 | $(MKCONV) -o conv255.cph -mode centered -dim 2 -h 5 -w 5 15 | 16 | 17 | -------------------------------------------------------------------------------- /examples/working/conv/mkconv1/main.rules: -------------------------------------------------------------------------------- 1 | lena128.bin: ../lena128.pgm 2 | $(PGM2BIN) -hblank 4 -vblank 140 24 $< $@ 3 | -------------------------------------------------------------------------------- /examples/working/conv/mkconv2/lena128.pgm: -------------------------------------------------------------------------------- 1 | ../../../imgs/lena128.pgm -------------------------------------------------------------------------------- /examples/working/conv/mkconv2/main.procs: -------------------------------------------------------------------------------- 1 | PRE_PROC = pgm2txt -abbrev lena128.pgm lena128.txt 2 | PRE_PROC = mkconv -o conv233.cph -mode shifted -dim 2 -h 3 -w 3 3 | PRE_PROC = mkconv -o conv213.cph -mode shifted -dim 2 -h 1 -w 3 4 | PRE_PROC = mkconv -o conv231.cph -mode shifted -dim 2 -h 3 -w 1 5 | POST_PROC = txt2pgm -abbrev 255 sim/result1.txt sim/result1.pgm 6 | POST_PROC = txt2pgm -abbrev 255 sim/result2.txt sim/result2.pgm 7 | POST_PROC = txt2pgm -abbrev 255 sim/result3.txt sim/result3.pgm 8 | -------------------------------------------------------------------------------- /examples/working/conv/mkconv2/main.proj: -------------------------------------------------------------------------------- 1 | DOT_OPTS = -I .. -D arg1=lena128.pgm -D arg2=255 2 | SIM_OPTS = -I .. -abbrev_dc_ctors -chan_cap 130 -D arg1=lena128.pgm -D arg2=255 3 | SC_OPTS = -I .. -sc_abbrev_dc_ctors -sc_default_fifo_capacity 130 -sc_stop_time 800000 -sc_dump_fifo_stats -D arg1=lena128.pgm -D arg2=255 4 | VHDL_OPTS = -I .. -D arg1=lena128.pgm -D arg2=255 -vhdl_annot_file ../systemc/fifo_stats.dat 5 | GHDL_RUN_OPTS = --stop-time=640000ns 6 | 7 | GEN_CAPH_SRCS = conv213.cph conv231.cph conv233.cph 8 | 9 | conv233.cph: 10 | ../../../../bin/mkconv -o conv233.cph -mode shifted -dim 2 -h 3 -w 3 11 | 12 | conv213.cph: 13 | ../../../../bin/mkconv -o conv213.cph -mode shifted -dim 2 -h 1 -w 3 14 | 15 | conv231.cph: 16 | ../../../../bin/mkconv -o conv231.cph -mode shifted -dim 2 -h 3 -w 1 17 | -------------------------------------------------------------------------------- /examples/working/dpn/ex1-4/main.proj: -------------------------------------------------------------------------------- 1 | DOT_OPTS = -infer_mocs 2 | SIM_OPTS = -stop_after 20 3 | SC_OPTS = -sc_stop_time 300 -sc_dump_fifo_stats 4 | VHDL_OPTS = 5 | GHDL_RUN_OPTS = --stop-time=300ns --vcd=mainscale_tb.vcd 6 | -------------------------------------------------------------------------------- /examples/working/dpn/ex1-4/sample.txt: -------------------------------------------------------------------------------- 1 | < 10 20 30 40 80 > 2 | -------------------------------------------------------------------------------- /examples/working/dpn/ex1-8/main.cph: -------------------------------------------------------------------------------- 1 | -- This example is a direct transcription of the program of Fig 1.8 in [Parks95] 2 | -- It is a variation of the example 1.4 3 | -- Contrary to the latter, it blocks 4 | -- May 8, 2019 - JS 5 | 6 | type int8 == signed<8>; 7 | 8 | actor f in (u: int8, v: int) out (w: int) 9 | var st: {L,R} = L 10 | rules 11 | | (st:L, u:u) -> (w:u, st:R) 12 | | (st:R, v:v) -> (w:v, st:L) 13 | ; 14 | 15 | actor g in (u: int8) out (v: int, w: int) 16 | var st: {L,R} = L 17 | rules 18 | | (st:L, u:u) -> (v:u, st:R) 19 | | (st:R, u:u) -> (w:u, st:L) 20 | ; 21 | 22 | actor h (x: int8) in (u: int) out (v: int) 23 | var st: {I, R} = I 24 | rules 25 | | st:I -> (v:x, st:R) 26 | | (st:R, u:u) -> v:u 27 | ; 28 | 29 | net rec x = f (y, t2) 30 | and y = h 0 t1 31 | and (t1,t2) = g x; 32 | 33 | stream xo:int8 to "x.txt"; -- for visualizing the data circulating on channel x 34 | net xo = x; 35 | 36 | -------------------------------------------------------------------------------- /examples/working/dpn/ex1-8/main.proj: -------------------------------------------------------------------------------- 1 | DOT_OPTS = -infer_mocs 2 | SIM_OPTS = -stop_after 20 3 | SC_OPTS = -sc_stop_time 300 -sc_dump_fifo_stats 4 | VHDL_OPTS = 5 | GHDL_RUN_OPTS = --stop-time=300ns --vcd=mainscale_tb.vcd 6 | -------------------------------------------------------------------------------- /examples/working/dpn/ex1-8/sample.txt: -------------------------------------------------------------------------------- 1 | < 10 20 30 40 80 > 2 | -------------------------------------------------------------------------------- /examples/working/dpn/ex3-5/main.proj: -------------------------------------------------------------------------------- 1 | DOT_OPTS = -infer_mocs -dump_fsms 2 | SIM_OPTS = -stop_after 50 -dump_channel_stats 3 | SC_OPTS = -sc_stop_time 300 -sc_dump_fifo_stats 4 | VHDL_OPTS = 5 | GHDL_RUN_OPTS = --stop-time=300ns --vcd=mainscale_tb.vcd 6 | -------------------------------------------------------------------------------- /examples/working/dpn/ex3-5/sample.txt: -------------------------------------------------------------------------------- 1 | < 10 20 30 40 80 > 2 | -------------------------------------------------------------------------------- /examples/working/fir/fir12/main.cph: -------------------------------------------------------------------------------- 1 | -- 1x2 Finite Impulse Response filter 2 | -- FIR: = 3 | -- where 4 | -- Li= 5 | -- f:Li=<0,k1*Pi1+k2*Pi2,k1*Pi2+k2*Pi3,...> 6 | -- Jul 11, 2011 - JS 7 | 8 | 9 | #include "dc.cph" 10 | 11 | actor fir (k:signed<8> array[2]) 12 | in (a:signed<8> dc) 13 | out (c:signed<8> dc) 14 | var s : {S0,S1,S2,S3} = S0 15 | var z : signed<8> 16 | rules 17 | (s, a) -> (s, c, z) 18 | | (S0, '<) -> (S1, '<, _) 19 | | (S1, '>) -> (S0, '>, _) 20 | | (S1, '<) -> (S2, '<, _) 21 | | (S2, 'p) -> (S3, '0, p) 22 | | (S3, 'p) -> (S3, '(z*k[0]+p*k[1]), p) 23 | | (S3, 'p) -> (S3, 'z, p) 24 | | (S3, '>) -> (S1, '>, _) 25 | ; 26 | 27 | stream i:signed<8> dc from "sample.txt"; 28 | stream o:signed<8> dc to "result.txt"; 29 | 30 | net o = fir [1,2] i; 31 | 32 | -------------------------------------------------------------------------------- /examples/working/fir/fir12/main.proj: -------------------------------------------------------------------------------- 1 | DOT_OPTS = 2 | SIM_OPTS = -abbrev_dc_ctors 3 | SC_OPTS = -sc_stop_time 400 -sc_abbrev_dc_ctors 4 | VHDL_OPTS = 5 | GHDL_RUN_OPTS = --stop-time=600ns 6 | -------------------------------------------------------------------------------- /examples/working/fir/fir12/sample.txt: -------------------------------------------------------------------------------- 1 | < < 1 2 3 4 > < 1 2 3 4 > < 1 2 3 4 > < 1 2 3 4 > > 2 | -------------------------------------------------------------------------------- /examples/working/fir/fir13/main.cph: -------------------------------------------------------------------------------- 1 | -- 1x3 Finite Impulse Response filter on unstructured streams - mono-actor version 2 | -- FIR(a,v):x_0,x_1,x_2,x_3,... = y_0,y_1,y_2,y_3,... 3 | -- where 4 | -- y_i=a_0*y_{i-2}+a_1*x_{i-1}+a_2*x_i 5 | -- x_{-1}=x_{-2}=v 6 | -- Jul 15, 2015 - JS 7 | 8 | actor fir (a:int array[3], v:int) 9 | in (i:int) 10 | out (o:int) 11 | var z : int array[2] = [ v | i=0 to 1 ] 12 | rules 13 | | i:x -> (o:a[0]*z[0]+a[1]*z[1]+a[2]*x, z[0]:z[1], z[1]:x) 14 | ; 15 | 16 | stream i:signed<8> from "sample.txt"; 17 | stream o:signed<8> to "result.txt"; 18 | 19 | net o = fir ([1,2,1],0) i; 20 | --net o = fir ([1,0,0],0) i; 21 | 22 | -------------------------------------------------------------------------------- /examples/working/fir/fir13/main.proj: -------------------------------------------------------------------------------- 1 | DOT_OPTS = 2 | SIM_OPTS = 3 | SC_OPTS = -sc_stop_time 800 4 | VHDL_OPTS = 5 | GHDL_RUN_OPTS = --stop-time=600ns 6 | -------------------------------------------------------------------------------- /examples/working/fir/fir13/sample.txt: -------------------------------------------------------------------------------- 1 | 5 5 5 5 5 5 10 10 10 10 10 10 5 5 5 5 5 5 10 10 10 10 10 10 2 | -------------------------------------------------------------------------------- /examples/working/fir/fir1n/main.cph: -------------------------------------------------------------------------------- 1 | -- 1xn Finite Impulse Response filter on unstructured streams - multi-actor version 2 | -- Instantiated here with n=5 3 | -- This example illustrates the power of the [chain] and [foldli] higher-order wiring primitives 4 | -- May 7, 2019 - JS 5 | 6 | #include "stream_ops.cph" -- for [d], one-sample delay actor 7 | 8 | const coeff = [1,2,3,2,1] : signed<12> array[5]; 9 | 10 | actor madd (j:unsigned<4>) 11 | in (acc:int, tap:int) 12 | out (o:int) 13 | rules 14 | | (acc:s, tap:x) -> o:x*coeff[j]+s 15 | ; 16 | 17 | net fir x = 18 | let xs = chain 5 (d 0) x in 19 | foldli madd x xs; 20 | 21 | stream i:signed<12> from "sample.txt"; 22 | stream o:signed<12> to "result.txt"; 23 | 24 | net o = fir i; 25 | -------------------------------------------------------------------------------- /examples/working/fir/fir1n/main.proj: -------------------------------------------------------------------------------- 1 | DOT_OPTS = 2 | SIM_OPTS = 3 | SC_OPTS = -sc_stop_time 400 -sc_dump_fifo_stats 4 | VHDL_OPTS = -vhdl_annot_file ./systemc/fifo_stats.dat 5 | GHDL_RUN_OPTS = --stop-time=600ns 6 | -------------------------------------------------------------------------------- /examples/working/fir/fir1n/sample.txt: -------------------------------------------------------------------------------- 1 | 5 5 5 5 5 5 10 10 10 10 10 10 5 5 5 5 5 5 10 10 10 10 10 10 2 | -------------------------------------------------------------------------------- /examples/working/fir/fir22/main.proj: -------------------------------------------------------------------------------- 1 | DOT_OPTS = -I $(CAPHLIB) 2 | SIM_OPTS = -I $(CAPHLIB) -abbrev_dc_ctors 3 | SC_OPTS = -I $(CAPHLIB) -sc_stop_time 800 -sc_abbrev_dc_ctors 4 | VHDL_OPTS = -I $(CAPHLIB) 5 | GHDL_RUN_OPTS = --stop-time=1200ns 6 | -------------------------------------------------------------------------------- /examples/working/fir/fir22/sample.txt: -------------------------------------------------------------------------------- 1 | < < 1 2 3 4 5 6 > < 1 2 3 4 5 6 > < 1 2 3 4 5 6 > < 1 2 3 4 5 6 > < 1 2 3 4 5 6 > < 1 2 3 4 5 6 > > 2 | -------------------------------------------------------------------------------- /examples/working/fir/fir33sep/main.cph: -------------------------------------------------------------------------------- 1 | -- 3x3 Finite Impulse Response filter on images, with scaling and padding, separated 2 | -- FIR33(a,p,s) = FIR31(a,p,s) o FIR13(a,p,s) 3 | -- For each separate filter we have two distinct implementations : mono and multi-actor. 4 | -- This gives four possible implementations for FIR33 5 | -- These implementations are selected by (un)commenting the corresponding [include] directives 6 | -- Aug 1, 2015. JS 7 | 8 | const coeff = [1,2,1] : signed<12> array[3]; 9 | 10 | #include "xfir13_mono.cph" 11 | -- #include "xfir13_multi.cph" 12 | #include "xfir31_mono.cph" 13 | -- #include "xfir31_multi.cph" 14 | 15 | stream i:signed<12> dc from "sample.txt"; 16 | stream o:signed<12> dc to "result.txt"; 17 | 18 | net compose f g x = g (f x); 19 | 20 | net fir33 pad norm = compose (fir13 pad norm) (fir31 pad norm); 21 | 22 | net o = fir33 0 2 i; 23 | 24 | -------------------------------------------------------------------------------- /examples/working/fir/fir33sep/main.proj: -------------------------------------------------------------------------------- 1 | DOT_OPTS = -I .. # -dump_fsms 2 | SIM_OPTS = -I .. -abbrev_dc_ctors # -dump_channel_stats 3 | SC_OPTS = -I .. -sc_abbrev_dc_ctors -sc_stop_time 1400 -sc_dump_fifo_stats 4 | VHDL_OPTS = -I .. -abbrev_dc_ctors -vhdl_annot_file ./systemc/fifo_stats.dat 5 | GHDL_RUN_OPTS = --stop-time=2400ns 6 | -------------------------------------------------------------------------------- /examples/working/fir/fir33sep/misc.cph: -------------------------------------------------------------------------------- 1 | -- Several actors used both by the 1x3 and 3x1 multi-actor versions of the FIRs 2 | 3 | actor mult (j:unsigned<4>) 4 | in (i:int dc) 5 | out (o:int dc) 6 | rules i -> o 7 | | '< -> '< 8 | | '> -> '> 9 | | 'x -> 'coeff[j]*x 10 | ; 11 | 12 | actor add 13 | in (i1:int dc, i2:int dc) 14 | out (o:int dc) 15 | rules (i1,i2) -> o 16 | | ('<,'<) -> '< 17 | | ('>,'>) -> '> 18 | | ('x,'y) -> 'x+y 19 | ; 20 | 21 | actor shift (s:unsigned<4>) 22 | in (i:int dc) 23 | out (o:int dc) 24 | rules i -> o 25 | | '< -> '< 26 | | '> -> '> 27 | | 'x -> 'x>>s 28 | ; 29 | 30 | -------------------------------------------------------------------------------- /examples/working/fir/fir33sep/sample.txt: -------------------------------------------------------------------------------- 1 | < < 239 32 255 17 240 3 190 0 > < 48 32 17 42 43 48 31 34 > < 33 36 32 255 255 255 255 255 > < 255 255 255 32 0 1 16 16 > < 16 16 0 0 0 0 0 0 > < 0 0 176 208 224 240 224 255 > < 0 255 0 255 0 255 0 80 > < 64 48 32 16 255 253 221 208 > > 2 | -------------------------------------------------------------------------------- /examples/working/float/fscale/main.cph: -------------------------------------------------------------------------------- 1 | -- A small example illustrating the use of the [float] type 2 | -- Dec 21, 2012, JS 3 | 4 | #include "dc.cph" 5 | 6 | actor scale (k:float) 7 | in (a:float dc) 8 | out (c:float dc) 9 | rules a -> c 10 | | '< -> '< 11 | | '> -> '> 12 | | 'p -> 'p *. k 13 | ; 14 | 15 | stream i:float dc from "sample.txt"; 16 | stream o:float dc to "result.txt"; 17 | 18 | net o = scale 2.0 i; 19 | 20 | -------------------------------------------------------------------------------- /examples/working/float/fscale/main.proj: -------------------------------------------------------------------------------- 1 | DOT_OPTS = 2 | SIM_OPTS = -abbrev_dc_ctors 3 | SC_OPTS = -sc_stop_time 100 -sc_abbrev_dc_ctors 4 | VHDL_OPTS = -vhdl_float_support 5 | GHDL_RUN_OPTS = --stop-time=200ns 6 | VHDL_FP_LIB=/Users/jserot/Dev/vhdl/fp-altera 7 | -------------------------------------------------------------------------------- /examples/working/float/fscale/sample.txt: -------------------------------------------------------------------------------- 1 | < 10.1 20.1 30.1 40.1 80.1 160.1 > 2 | -------------------------------------------------------------------------------- /examples/working/float/heron/main.cph: -------------------------------------------------------------------------------- 1 | -- Iterative computing of \sqrt(a) using Heron's algorithm 2 | -- 2013-01-08, JS 3 | 4 | function f_abs x = if x <. 0.0 then -.x else x : float -> float; 5 | function stop (x,a,eps) = f_abs(x *. x -. a) <. eps; 6 | function iter (x,a) = (x +. a /. x) /. 2.0; 7 | 8 | actor heron (eps: float) 9 | in (i: float) 10 | out (r: float, niter: unsigned<10>) 11 | var a: float 12 | var x: float 13 | var state: {Idle, Iter} = Idle 14 | var n: unsigned<10> 15 | rules 16 | | (state:Idle, i:u) -> (state:Iter, a:u, x:u, n:0) 17 | | state:Iter when stop (x,a,eps) -> (state:Idle, r:x, niter:n) 18 | | state:Iter -> (state:Iter, x:iter(x,a), n:n+1) 19 | ; 20 | 21 | stream a:float from "sample.txt"; 22 | stream r:float to "result1.txt"; 23 | stream n:unsigned<10> to "result2.txt"; 24 | 25 | net (r,n) = heron 0.000001 a; 26 | -------------------------------------------------------------------------------- /examples/working/float/heron/main.proj: -------------------------------------------------------------------------------- 1 | SIM_OPTS = -chan_cap 16 2 | SC_OPTS = -sc_stop_time 800 # -dump_ir -sc_dump_fifo_stats 3 | VHDL_OPTS = -vhdl_float_support -vhdl_annot_file heron_fifo_stats.dat 4 | GHDL_RUN_OPTS = --stop-time=200ns 5 | VHDL_FP_LIB=/Users/jserot/Dev/vhdl/fp-altera 6 | -------------------------------------------------------------------------------- /examples/working/float/heron/sample.txt: -------------------------------------------------------------------------------- 1 | 2.0 2 | -------------------------------------------------------------------------------- /examples/working/ho/binimg/main.cph: -------------------------------------------------------------------------------- 1 | -- Rewritting of the [../apps/binimg] application with the [smap] higher-order actor 2 | -- 2016-05-27, JS 3 | 4 | #include "dc.cph" 5 | 6 | function f_thr(x) = if x > %th then (1:unsigned<1>) else (0:unsigned<1>) : signed -> unsigned<1>; 7 | 8 | stream inp:signed<10> dc from %ifile; 9 | stream res:unsigned<1> dc to "result.txt"; 10 | 11 | net res = smap f_thr inp; 12 | -------------------------------------------------------------------------------- /examples/working/ho/binimg/main.proj: -------------------------------------------------------------------------------- 1 | DOT_OPTS = -D ifile=lena64.txt -D th=120S 2 | SIM_OPTS = -chan_cap 130 -suppress_cast_warnings -D ifile=lena64.txt -D th=120S -abbrev_dc_ctors 3 | SC_OPTS = -suppress_cast_warnings -D ifile=lena64.txt -D th=120S -sc_default_fifo_capacity 256 -sc_stop_time 200000 -sc_abbrev_dc_ctors -sc_dump_fifo_stats # -dump_typed 4 | VHDL_OPTS = -D ifile=lena64.txt -D th=120S -vhdl_annot_file binimg_fifo_stats.dat 5 | GHDL_RUN_OPTS = --stop-time=400000ns 6 | -------------------------------------------------------------------------------- /examples/working/ho/fmap/main.proj: -------------------------------------------------------------------------------- 1 | SIM_OPTS = -suppress_cast_warnings 2 | SC_OPTS = -sc_stop_time 200 # -dump_ir -suppress_cast_warnings 3 | VHDL_OPTS = -suppress_cast_warnings 4 | GHDL_RUN_OPTS = --stop-time=800ns 5 | -------------------------------------------------------------------------------- /examples/working/ho/fmap/sample1.txt: -------------------------------------------------------------------------------- 1 | 1 2 3 4 2 | -------------------------------------------------------------------------------- /examples/working/ho/fmap/sample2.txt: -------------------------------------------------------------------------------- 1 | 1 2 3 4 2 | -------------------------------------------------------------------------------- /examples/working/ho/foldn/main.proj: -------------------------------------------------------------------------------- 1 | DOT_OPTS = 2 | SIM_OPTS = 3 | SC_OPTS = -sc_stop_time 200 # -dump_ir 4 | VHDL_OPTS = 5 | GHDL_RUN_OPTS = --stop-time=800ns 6 | -------------------------------------------------------------------------------- /examples/working/ho/foldn/sample1.txt: -------------------------------------------------------------------------------- 1 | 1 2 3 4 5 6 7 8 9 10 11 12 13 2 | -------------------------------------------------------------------------------- /examples/working/ho/foldn/sample2.txt: -------------------------------------------------------------------------------- 1 | 1 2 3 4 5 6 7 8 9 10 2 | -------------------------------------------------------------------------------- /examples/working/ho/grad/main.cph: -------------------------------------------------------------------------------- 1 | -- Basic gradient computing 2 | -- Examples given in [../apps/grad] rewritten with the [smap] and [smap2] HO actors 3 | -- 2016-05-27, JS 4 | 5 | #include "dc.cph" -- to get the [smap] and [smap2] HO actors 6 | #include "img_ops.cph" -- to get the [d1p] and [d1l] actors 7 | 8 | function f_abs x = if x < 0 then -x else x : signed -> signed; 9 | function f_thr(x) = if x > %th then (1:unsigned<1>) else (0:unsigned<1>) : signed -> unsigned<1>; 10 | function f_add(x,y) = x+y : signed * signed -> signed; 11 | function f_sub(x,y) = f_abs(x-y) : signed * signed -> signed; 12 | 13 | net dx i = smap2 f_sub (i, d1p 0 i); 14 | net dy i = smap2 f_sub (i, d1l 0 i); 15 | 16 | stream inp:signed<10> dc from %ifile; 17 | stream res:unsigned<1> dc to "result.txt"; 18 | 19 | net res = smap f_thr (smap2 f_add (dx inp, dy inp)); 20 | -------------------------------------------------------------------------------- /examples/working/ho/grad/main.proj: -------------------------------------------------------------------------------- 1 | DOT_OPTS = -D ifile=lena64.txt -D th=40S 2 | SIM_OPTS = -chan_cap 130 -suppress_cast_warnings -D ifile=lena64.txt -D th=40S -abbrev_dc_ctors 3 | SC_OPTS = -suppress_cast_warnings -D ifile=lena64.txt -D th=40S -sc_default_fifo_capacity 256 -sc_stop_time 200000 -sc_abbrev_dc_ctors -sc_dump_fifo_stats # -dump_typed 4 | VHDL_OPTS = -D ifile=lena64.txt -D th=40S -vhdl_annot_file ./systemc/fifo_stats.dat 5 | GHDL_RUN_OPTS = --stop-time=400000ns 6 | -------------------------------------------------------------------------------- /examples/working/ho/sfold/main.proj: -------------------------------------------------------------------------------- 1 | DOT_OPTS = 2 | SIM_OPTS = -abbrev_dc_ctors 3 | SC_OPTS = -sc_abbrev_dc_ctors -sc_stop_time 200 # -dump_ir 4 | VHDL_OPTS = 5 | GHDL_RUN_OPTS = --stop-time=800ns 6 | -------------------------------------------------------------------------------- /examples/working/ho/sfold/sample1.txt: -------------------------------------------------------------------------------- 1 | < 1 2 > < 3 4 5 > < 6 7 8 9 > 2 | -------------------------------------------------------------------------------- /examples/working/ho/sfold/sample2.txt: -------------------------------------------------------------------------------- 1 | < 1 2 3 > < 4 5 6 > < 7 8 9 > 2 | -------------------------------------------------------------------------------- /examples/working/ho/smap/main.cph: -------------------------------------------------------------------------------- 1 | -- Another example of higher order actor, here the [smap] actor defined in [lib/caph/dc.cph] 2 | -- The [smap] actor takes a structured stream and applies its parameter [f] to each [Data] component 3 | -- of the stream, and simply copying the [SoS] and [EoS] tokens 4 | -- Ex : smap f : < x1 x2 ... xn > = < f(x1) f(x2) ... f(xn) > 5 | -- smap f : < < x1 x2 ... xn > ... > = < < f(x1) f(x2) ... f(xn) > ... > 6 | -- 2016-05-26, JS 7 | 8 | #include "dc.cph" 9 | 10 | function f1 x = (2:signed<8>)*x : signed<8> -> signed<8>; 11 | function f2 x = x+(1:unsigned<16>) : unsigned<16> -> unsigned<16>; 12 | 13 | stream i1:signed<8> dc from "sample1.txt"; 14 | stream o1:signed<8> dc to "result1.txt"; 15 | stream i2:unsigned<16> dc from "sample2.txt"; 16 | stream o2:unsigned<16> dc to "result2.txt"; 17 | 18 | net o1 = smap f1 i1; 19 | net o2 = smap f2 i2; 20 | -------------------------------------------------------------------------------- /examples/working/ho/smap/main.proj: -------------------------------------------------------------------------------- 1 | DOT_OPTS = 2 | SIM_OPTS = -abbrev_dc_ctors 3 | SC_OPTS = -sc_abbrev_dc_ctors -sc_stop_time 200 # -dump_ir 4 | VHDL_OPTS = 5 | GHDL_RUN_OPTS = --stop-time=800ns 6 | -------------------------------------------------------------------------------- /examples/working/ho/smap/sample1.txt: -------------------------------------------------------------------------------- 1 | < 1 2 3 4 > 2 | -------------------------------------------------------------------------------- /examples/working/ho/smap/sample2.txt: -------------------------------------------------------------------------------- 1 | < < 1 2 > < 3 4 > > 2 | -------------------------------------------------------------------------------- /examples/working/ho/smap2/main.cph: -------------------------------------------------------------------------------- 1 | -- The [smap2] higher order actor, also defined in [lib/caph/dc.cph] generalizes [smap] to operate 2 | -- on two concurrent input streams. 3 | -- 2016-05-26, JS 4 | 5 | #include "dc.cph" 6 | 7 | function f (x,y) = x+y+(1:signed<8>) : signed<8> * signed<8> -> signed<8>; 8 | 9 | stream i11:signed<8> dc from "sample11.txt"; 10 | stream i12:signed<8> dc from "sample11.txt"; 11 | stream o1:signed<8> dc to "result1.txt"; 12 | 13 | net o1 = smap2 f (i11,i12); 14 | -------------------------------------------------------------------------------- /examples/working/ho/smap2/main.proj: -------------------------------------------------------------------------------- 1 | DOT_OPTS = 2 | SIM_OPTS = -abbrev_dc_ctors 3 | SC_OPTS = -sc_abbrev_dc_ctors -sc_stop_time 200 # -dump_ir 4 | VHDL_OPTS = 5 | GHDL_RUN_OPTS = --stop-time=800ns 6 | -------------------------------------------------------------------------------- /examples/working/ho/smap2/sample11.txt: -------------------------------------------------------------------------------- 1 | < 1 2 3 4 > 2 | -------------------------------------------------------------------------------- /examples/working/ho/smap2/sample12.txt: -------------------------------------------------------------------------------- 1 | < 1 2 3 4 > 2 | -------------------------------------------------------------------------------- /examples/working/ho/ssfold/main.cph: -------------------------------------------------------------------------------- 1 | -- The [ssfold] actor, defined in [lib/caph/dc.cph] is a generalisation of [sfold] operating on lists of lists 2 | -- We use it here to compute the horizontal projection of an image. 3 | -- This formulation is to be compared to the one given in [examples/apps/hproj] ... 4 | -- 2016-05-26, JS 5 | 6 | #include "dc.cph" 7 | 8 | function add (x,y) = x+y : unsigned<16> * unsigned<16> -> unsigned<16>; -- the reduction function 9 | 10 | stream i:unsigned<16> dc from "img.txt"; 11 | stream o:unsigned<16> dc to "result.txt"; 12 | 13 | net o = ssfold (add,0) i; 14 | -------------------------------------------------------------------------------- /examples/working/ho/ssfold/main.proj: -------------------------------------------------------------------------------- 1 | DOT_OPTS = 2 | SIM_OPTS = -abbrev_dc_ctors 3 | SC_OPTS = -sc_dump_fifo_stats -sc_stop_time 48000 -sc_abbrev_dc_ctors 4 | VHDL_OPTS = 5 | 6 | GHDL_RUN_OPTS = --stop-time=160000ns 7 | -------------------------------------------------------------------------------- /examples/working/io/fglob1/Readme: -------------------------------------------------------------------------------- 1 | This example shows how to use the file globbing and input blanking facilities 2 | -------------------------------------------------------------------------------- /examples/working/io/fglob1/main.cph: -------------------------------------------------------------------------------- 1 | #include "dc.cph" 2 | 3 | actor scale (k:unsigned<8>) 4 | in (a:unsigned<8> dc) 5 | out (c:unsigned<8> dc) 6 | rules a -> c 7 | | '< -> '< 8 | | 'p -> 'p*k 9 | | '> -> '> 10 | ; 11 | 12 | stream i:unsigned<8> dc from "sample_[1-2].txt"; 13 | stream o:unsigned<8> dc to "result_[1-2].txt"; 14 | 15 | net o = scale 2 i; 16 | -------------------------------------------------------------------------------- /examples/working/io/fglob1/main.proj: -------------------------------------------------------------------------------- 1 | SIM_OPTS = -abbrev_dc_ctors -split_output_frames 2 | SC_OPTS = -sc_stop_time 2000 -sc_abbrev_dc_ctors -sc_istream_hblank 2 -sc_istream_vblank 4 -split_output_frames # -sc_trace 3 | VHDL_OPTS = -vhdl_istream_blanking -split_output_frames 4 | GHDL_RUN_OPTS = --stop-time=4000ns --vcd=main_tb.vcd 5 | -------------------------------------------------------------------------------- /examples/working/io/fglob1/main.rules: -------------------------------------------------------------------------------- 1 | sample_1.bin: ../sample_1.txt 2 | $(TXT2BIN) -dc -abbrev -hblank 2 -vblank 4 uint 8 $< > $@ 3 | -------------------------------------------------------------------------------- /examples/working/io/fglob1/sample_1.txt: -------------------------------------------------------------------------------- 1 | < < 1 2 3 4 > < 1 2 3 4 > < 1 2 3 4 > < 1 2 3 4 > > 2 | -------------------------------------------------------------------------------- /examples/working/io/fglob1/sample_2.txt: -------------------------------------------------------------------------------- 1 | < < 5 6 7 8 > < 5 6 7 8 > < 5 6 7 8 > < 5 6 7 8 > > 2 | -------------------------------------------------------------------------------- /examples/working/io/fglob2/Readme: -------------------------------------------------------------------------------- 1 | This example shows how to use the file globbing and input blanking facilities for processing sequence of images 2 | -------------------------------------------------------------------------------- /examples/working/io/fglob2/main.cph: -------------------------------------------------------------------------------- 1 | #include "dc.cph" 2 | 3 | actor inv 4 | in (a:unsigned<8> dc) 5 | out (c:unsigned<8> dc) 6 | rules a -> c 7 | | '< -> '< 8 | | 'p -> '255-p 9 | | '> -> '> 10 | ; 11 | 12 | stream i:unsigned<8> dc from "im-[1-4].pgm"; 13 | stream o:unsigned<8> dc to "result-[1-4].pgm"; 14 | 15 | net o = inv i; 16 | -------------------------------------------------------------------------------- /examples/working/io/fglob2/main.proj: -------------------------------------------------------------------------------- 1 | SIM_OPTS = -abbrev_dc_ctors -split_output_frames 2 | SC_OPTS = -sc_stop_time 400000 -sc_abbrev_dc_ctors -sc_istream_hblank 2 -sc_istream_vblank 4 -split_output_frames 3 | VHDL_OPTS = -vhdl_istream_blanking -split_output_frames 4 | GHDL_RUN_OPTS = --stop-time=800000ns 5 | -------------------------------------------------------------------------------- /examples/working/io/portio/Readme: -------------------------------------------------------------------------------- 1 | This example shows how to use [ports] (as opposed as [streams]) to perform asynchronous I/O. Here 2 | the [scale] actor multiplies each value token, read on stream [i1] by a factor [k] provided by input 3 | port [i2]. The initial value of [k] is 2. According the event file "factors.txt" attached to port 4 | [i2], this value is changed to 10 at time t=100. 5 | The [scale] actor also produced the value 100 on output port [o2] each time it finishes the processing of 6 | line of tokens. 7 | 8 | Nov 26, 2014. JS 9 | -------------------------------------------------------------------------------- /examples/working/io/portio/factors.txt: -------------------------------------------------------------------------------- 1 | # sim_cycle sc_time vhdl_time value 2 | 9 100 200 10 3 | -------------------------------------------------------------------------------- /examples/working/io/portio/main.cph: -------------------------------------------------------------------------------- 1 | #include "dc.cph" 2 | 3 | actor scale 4 | in (a:unsigned<10> dc, s:unsigned<10>) 5 | out (c:unsigned<10> dc, eol:unsigned<10>) 6 | rules 7 | | a:'< -> c:'< 8 | | (a:'p, s:k) -> c:'p*k 9 | | a:'> -> (c:'>, eol:100) 10 | ; 11 | 12 | stream i1:unsigned<10> dc from "sample.txt"; 13 | port i2:unsigned<10> from "factors.txt" init 2; 14 | stream o1:unsigned<10> dc to "result1.txt"; 15 | port o2:unsigned<10> to "result2.txt"; 16 | 17 | net (o1,o2) = scale (i1,i2); 18 | -------------------------------------------------------------------------------- /examples/working/io/portio/main.proj: -------------------------------------------------------------------------------- 1 | SIM_OPTS = -abbrev_dc_ctors -trace_ports -suppress_cast_warnings 2 | SC_OPTS = -sc_stop_time 300 -sc_abbrev_dc_ctors -sc_trace_fifos -sc_dump_fifo_stats -suppress_cast_warnings 3 | VHDL_OPTS = 4 | GHDL_RUN_OPTS = --stop-time=600ns --vcd=main_tb.vcd 5 | -------------------------------------------------------------------------------- /examples/working/io/portio/main.rules: -------------------------------------------------------------------------------- 1 | factors.bin: ../factors.txt 2 | $(TXT2BIN) -eventf uint 10 $< > $@ 3 | 4 | -------------------------------------------------------------------------------- /examples/working/io/portio/main_tb.sav: -------------------------------------------------------------------------------- 1 | [*] 2 | [*] GTKWave Analyzer v3.3.54 (w)1999-2014 BSI 3 | [*] Sun Sep 20 17:22:23 2015 4 | [*] 5 | [dumpfile] "/Users/jserot/Dev/ml/caph/working/examples/working/io/portio/main_tb.vcd" 6 | [dumpfile_mtime] "Sun Sep 20 17:19:54 2015" 7 | [dumpfile_size] 19417 8 | [savefile] "/Users/jserot/Dev/ml/caph/working/examples/working/io/portio/main_tb.sav" 9 | [timestart] 0 10 | [size] 1000 600 11 | [pos] -1 -1 12 | *-26.495905 -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 -1 13 | [treeopen] n. 14 | [sst_width] 198 15 | [signals_width] 116 16 | [sst_expanded] 1 17 | [sst_vpaned_height] 166 18 | @28 19 | b1.clk 20 | @22 21 | b1.dout[11:0] 22 | @25 23 | b2.dout[9:0] 24 | [pattern_trace] 1 25 | [pattern_trace] 0 26 | -------------------------------------------------------------------------------- /examples/working/io/portio/sample.txt: -------------------------------------------------------------------------------- 1 | < 1 2 3 4 5 6 7 8 > < 10 20 30 40 50 60 70 80 > 2 | -------------------------------------------------------------------------------- /examples/working/misc/bigfifo/lena64.pgm: -------------------------------------------------------------------------------- 1 | ../../../imgs/lena64.pgm -------------------------------------------------------------------------------- /examples/working/misc/bigfifo/main.procs: -------------------------------------------------------------------------------- 1 | PRE_PROC = pgm2txt -abbrev lena64.pgm lena64.txt 2 | POST_PROC = txt2pgm -abbrev 255 sim/result.txt sim/result.pgm 3 | -------------------------------------------------------------------------------- /examples/working/misc/bigfifo/main.proj: -------------------------------------------------------------------------------- 1 | DOT_OPTS = -D ifile=lena64.pgm 2 | SIM_OPTS = -D ifile=lena64.pgm -chan_cap 18000 -abbrev_dc_ctors 3 | SC_OPTS = -sc_default_fifo_capacity 5000 -sc_dump_fifo_stats -D ifile=lena64.pgm -sc_stop_time 85000 -sc_abbrev_dc_ctors 4 | VHDL_OPTS = -D ifile=lena64.pgm -vhdl_annot_file ./systemc/fifo_stats.dat 5 | GHDL_RUN_OPTS = --stop-time=240000ns 6 | -------------------------------------------------------------------------------- /examples/working/misc/ccond/main.cph: -------------------------------------------------------------------------------- 1 | -- This example shows how to use the #ifdef directive 2 | -- The symbol TWICE can be set by invoking the compiler with the "-D TWICE" option 3 | 4 | #include "dc.cph" 5 | 6 | actor scale (k:unsigned<10>) 7 | in (a:unsigned<10> dc) 8 | out (c:unsigned<10> dc) 9 | rules a -> c 10 | | '< -> '< 11 | | 'p -> 'p*k 12 | | '> -> '> 13 | ; 14 | 15 | stream i:unsigned<10> dc from "sample.txt"; 16 | stream o:unsigned<10> dc to "result.txt"; 17 | 18 | #ifdef TWICE 19 | net o = scale 2 (scale 2 i); 20 | #else 21 | net o = scale 2 i; 22 | #endif 23 | 24 | -------------------------------------------------------------------------------- /examples/working/misc/ccond/main.proj: -------------------------------------------------------------------------------- 1 | DOT_OPTS = -D TWICE 2 | SIM_OPTS = -abbrev_dc_ctors -D TWICE 3 | SC_OPTS = -sc_stop_time 200 -sc_abbrev_dc_ctors -D TWICE 4 | VHDL_OPTS = -D TWICE 5 | GHDL_RUN_OPTS = --stop-time=300ns 6 | -------------------------------------------------------------------------------- /examples/working/misc/ccond/sample.txt: -------------------------------------------------------------------------------- 1 | < 10 20 30 40 80 > 2 | -------------------------------------------------------------------------------- /examples/working/misc/fact/main.cph: -------------------------------------------------------------------------------- 1 | -- Computes the factorial of integers by intra-actor iteration 2 | -- To be compared with the program computing the same values using extra-actor feedback (network-level recursion) 3 | -- Dec 27, 2012 - JS 4 | 5 | type uint8 == unsigned<8>; 6 | 7 | actor fact 8 | in (a:uint8) 9 | out (c:uint8) 10 | var k: uint8 11 | var r: uint8 = 0 12 | var st: {S0,S1} = S0 13 | rules 14 | | (st:S0, a:n) -> (st:S1, k:n, r:1) 15 | | (st:S1, k:0) -> (st:S0, c:r) 16 | | (st:S1, k:m) -> (st:S1, k:m-1, r:(r*k:unsigned<8>)) 17 | -- | (st:S1, k:m) -> (st:S1, k:m-1, r:(r*m:unsigned<8>)) -- ALSO works 18 | -- | (st:S1) -> (st:S1, k:k-1, r:(r*k:unsigned<8>)) -- ALSO works 19 | ; 20 | 21 | stream i:uint8 from "sample.txt"; 22 | stream o:uint8 to "result.txt"; 23 | 24 | net o = fact i; 25 | -------------------------------------------------------------------------------- /examples/working/misc/fact/main.proj: -------------------------------------------------------------------------------- 1 | SIM_OPTS = -abbrev_dc_ctors 2 | SC_OPTS = -sc_stop_time 400 -sc_abbrev_dc_ctors 3 | VHDL_OPTS = 4 | GHDL_RUN_OPTS = --stop-time=2000ns 5 | -------------------------------------------------------------------------------- /examples/working/misc/fact/sample.txt: -------------------------------------------------------------------------------- 1 | 2 3 4 5 2 | -------------------------------------------------------------------------------- /examples/working/misc/factrec/main.cph: -------------------------------------------------------------------------------- 1 | -- Computes the factorial of integers by extra-actor feedback (network-level recursion) 2 | -- To be compared with the program computing the same values using intra-actor iteration 3 | -- Dec 27, 2012 - JS 4 | 5 | type uint == unsigned<8>; 6 | 7 | actor fact 8 | in (a:uint, k:uint, r:uint) 9 | out (c:uint, kk:uint, rr:uint) 10 | -- Note : stateless actor 11 | rules 12 | (a, k, r) -> ( kk, rr, c) 13 | | (_, 0, r) -> ( _, _, r) 14 | | (_, k, r) -> (k-1, (r*k:unsigned<8>), _) 15 | | (n, _, _) -> ( n, 1, _) 16 | ; 17 | 18 | stream i:uint from "sample.txt"; 19 | stream o:uint to "result.txt"; 20 | 21 | net o = 22 | let rec (c,k,r) = fact (i,k,r) in 23 | c 24 | ; 25 | -------------------------------------------------------------------------------- /examples/working/misc/factrec/main.proj: -------------------------------------------------------------------------------- 1 | SIM_OPTS = -abbrev_dc_ctors 2 | SC_OPTS = -sc_stop_time 400 -sc_abbrev_dc_ctors 3 | VHDL_OPTS = 4 | GHDL_RUN_OPTS = --stop-time=2000ns 5 | -------------------------------------------------------------------------------- /examples/working/misc/factrec/sample.txt: -------------------------------------------------------------------------------- 1 | 2 3 4 5 2 | -------------------------------------------------------------------------------- /examples/working/misc/foreign/extra/extfns.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | sc_int<8> mult(sc_int<8> x, sc_int<8> y) 4 | { 5 | sc_int<8> res = x*y; 6 | cout << "** mult(" << x << "," << y << ") -> " << res << endl; 7 | return res; 8 | } 9 | 10 | sc_int<8> incr(sc_int<8> x) 11 | { 12 | sc_int<8> res = x+1; 13 | cout << "** incr(" << x << ") -> " << res << endl; 14 | return res; 15 | } 16 | -------------------------------------------------------------------------------- /examples/working/misc/foreign/extra/extfns.h: -------------------------------------------------------------------------------- 1 | #ifndef _extfns_h 2 | #define _extfns_h 3 | 4 | sc_int<8> mult(sc_int<8> x, sc_int<8> y); 5 | sc_int<8> incr(sc_int<8> x); 6 | 7 | #endif 8 | -------------------------------------------------------------------------------- /examples/working/misc/foreign/extra/extfns.ml: -------------------------------------------------------------------------------- 1 | let mult [x;y] = x * y 2 | let incr [x] = x + 1 3 | 4 | let _ = Foreign.register "mult" mult 5 | let _ = Foreign.register "incr" incr 6 | -------------------------------------------------------------------------------- /examples/working/misc/foreign/extra/extfns.vhd: -------------------------------------------------------------------------------- 1 | library ieee; 2 | use ieee.std_logic_1164.all; 3 | use ieee.numeric_std.all; 4 | 5 | package extfns is 6 | function mult(a, b: signed(7 downto 0)) return signed; 7 | end extfns; 8 | 9 | package body extfns is 10 | 11 | function mult(a, b: signed(7 downto 0)) return signed is 12 | variable res : signed(15 downto 0); 13 | begin 14 | res := a * b; 15 | return res(7 downto 0); 16 | end; 17 | 18 | end package body extfns; 19 | 20 | 21 | -------------------------------------------------------------------------------- /examples/working/misc/foreign/main.cph: -------------------------------------------------------------------------------- 1 | -- This example shows to use external functions 2 | 3 | -- external fns section 4 | 5 | #include "dc.cph" 6 | 7 | function mult = extern "mult", "mult", "mult" : signed * signed -> signed; 8 | 9 | -- actor decl section 10 | 11 | actor scale (k:signed<8>) 12 | in (a:signed<8> dc) 13 | out (c:signed<8> dc) 14 | rules a -> c 15 | | '< -> '< 16 | | 'p -> '(mult(p,k)) 17 | | '> -> '>; 18 | 19 | stream i:signed<8> dc from "sample.txt"; 20 | stream o:signed<8> dc to "result.txt"; 21 | 22 | -- definition section 23 | 24 | net o = scale 2 i ; 25 | -------------------------------------------------------------------------------- /examples/working/misc/foreign/main.proj: -------------------------------------------------------------------------------- 1 | DOT_OPTS = 2 | SIM_OPTS = -abbrev_dc_ctors -sim_extra extfns.ml 3 | SC_OPTS = -sc_stop_time 400 -sc_abbrev_dc_ctors -sc_extra extfns.cpp 4 | VHDL_OPTS = -vhdl_extra extfns.vhd 5 | GHDL_RUN_OPTS = --stop-time=200ns 6 | 7 | CXXFLAGS = -I .. 8 | 9 | -------------------------------------------------------------------------------- /examples/working/misc/foreign/sample.txt: -------------------------------------------------------------------------------- 1 | < 1 2 3 4 > 2 | -------------------------------------------------------------------------------- /examples/working/misc/implemented/main.cph: -------------------------------------------------------------------------------- 1 | -- This example shows to use the "#pragma implemented" directive to insert pre-written VHDL 2 | -- code into CAPH programs. 3 | -- Warning : use of this feature is not encouraged as it may break out code portability 4 | 5 | #ifdef OPT_DIV 6 | #pragma implemented(div,vhdl,my_div) 7 | #endif 8 | 9 | actor div 10 | in (a:unsigned<8>, b:unsigned<8>) 11 | out (c:unsigned<8>) 12 | rules 13 | | (a:x, b:y) -> c:x/y 14 | ; 15 | 16 | 17 | stream i1:unsigned<8> from "sample1.txt"; 18 | stream i2:unsigned<8> from "sample2.txt"; 19 | stream o:unsigned<8> to "result.txt"; 20 | 21 | net o = div (i1,i2); 22 | -------------------------------------------------------------------------------- /examples/working/misc/implemented/main.proj: -------------------------------------------------------------------------------- 1 | DOT_OPTS = 2 | SIM_OPTS = 3 | SC_OPTS = -sc_stop_time 200 4 | VHDL_OPTS = -D OPT_DIV 5 | GHDL_RUN_OPTS = --stop-time=200ns 6 | -------------------------------------------------------------------------------- /examples/working/misc/implemented/sample1.txt: -------------------------------------------------------------------------------- 1 | 10 100 200 2 | -------------------------------------------------------------------------------- /examples/working/misc/implemented/sample2.txt: -------------------------------------------------------------------------------- 1 | 2 4 10 2 | -------------------------------------------------------------------------------- /examples/working/misc/ioless/main.cph: -------------------------------------------------------------------------------- 1 | -- This example shows how to write input or output-less actors 2 | -- This possibility appeared in version 2.9.1 3 | -- The [src] actor has not input but produces the stream 0,1,2,... 4 | -- The [snk] actor reads this stream but has no output. 5 | -- This example is of course of little practical utility. A more realistic variant is given in [../ioless2] 6 | -- May 2019 - JS 7 | 8 | actor src 9 | in (i: unit) 10 | out (o: unsigned<8>) 11 | var cnt: unsigned<8> = 0 12 | rules 13 | | i:_ -> (o:cnt, cnt:cnt+1) 14 | ; 15 | 16 | actor snk 17 | in (i: unsigned<8>) 18 | out (o: unit) 19 | var cnt: unsigned<8> = 0 20 | rules 21 | | i:x -> cnt:cnt+x 22 | ; 23 | 24 | net () = snk (src ()); 25 | -------------------------------------------------------------------------------- /examples/working/misc/ioless/main.proj: -------------------------------------------------------------------------------- 1 | DOT_OPTS = 2 | SIM_OPTS = -stop_after 10 -trace 3 | SC_OPTS = -sc_stop_time 200 4 | VHDL_OPTS = 5 | GHDL_RUN_OPTS = --stop-time=100ns 6 | -------------------------------------------------------------------------------- /examples/working/misc/ioless2/extra/read_data.cpp: -------------------------------------------------------------------------------- 1 | // This file is manually written. Do not erase it ! 2 | 3 | #include "read_data.h" 4 | 5 | void src_act::main(void) { 6 | cnt = 0; 7 | while ( 1 ) { 8 | wait(); // clk 9 | if ( (o->wr_rdy()) ) { // Output channel is ready for writing 10 | o->write(cnt); 11 | cnt = cnt+1; 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /examples/working/misc/ioless2/extra/read_data.h: -------------------------------------------------------------------------------- 1 | // This file is manually written. Do not erase it ! 2 | 3 | #ifndef _read_data_h 4 | #define _read_data_h 5 | 6 | #include 7 | #include "fifo.h" 8 | 9 | SC_MODULE(src_act) { 10 | sc_in clk; 11 | sc_port > > o; 12 | 13 | void main(void); 14 | 15 | SC_HAS_PROCESS(src_act); 16 | 17 | src_act(sc_module_name name_, bool trace_=false ) : 18 | modname(name_), sc_module(name_), trace(trace_) 19 | { 20 | SC_THREAD(main); 21 | sensitive << clk.pos(); 22 | } 23 | 24 | ~src_act() { } 25 | 26 | private: 27 | // Service 28 | bool trace; 29 | sc_module_name modname; 30 | // Parameters 31 | // Variables 32 | sc_uint<8> cnt; 33 | }; 34 | #endif 35 | -------------------------------------------------------------------------------- /examples/working/misc/ioless2/extra/write_result.cpp: -------------------------------------------------------------------------------- 1 | // This file is manually written. Do not erase it ! 2 | 3 | #include "write_result.h" 4 | 5 | void snk_act::main(void) { 6 | sc_uint<8> x; 7 | while ( 1 ) { 8 | wait(); // clk 9 | if ( (i->rd_rdy()) ) { // Input channel is ready for reading 10 | x = i->read(); 11 | cout << "** snk_act: " << x << endl; 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /examples/working/misc/ioless2/extra/write_result.h: -------------------------------------------------------------------------------- 1 | // This file is manually written. Do not erase it ! 2 | 3 | #ifndef _write_result_h 4 | #define _write_result_h 5 | 6 | #include 7 | #include "fifo.h" 8 | 9 | SC_MODULE(snk_act) { 10 | sc_in clk; 11 | sc_port > > i; 12 | 13 | void main(void); 14 | 15 | SC_HAS_PROCESS(snk_act); 16 | 17 | snk_act(sc_module_name name_, bool trace_=false ) : 18 | modname(name_), sc_module(name_), trace(trace_) 19 | { 20 | SC_THREAD(main); 21 | sensitive << clk.pos(); 22 | } 23 | 24 | ~snk_act() { } 25 | 26 | private: 27 | // Service 28 | bool trace; 29 | sc_module_name modname; 30 | }; 31 | #endif 32 | -------------------------------------------------------------------------------- /examples/working/misc/ioless2/main.proj: -------------------------------------------------------------------------------- 1 | DOT_OPTS = 2 | SIM_OPTS = -stop_after 10 -trace 3 | SC_OPTS = -sc_stop_time 200 4 | VHDL_OPTS = 5 | GHDL_RUN_OPTS = --stop-time=100ns 6 | -------------------------------------------------------------------------------- /examples/working/misc/macro/main.cph: -------------------------------------------------------------------------------- 1 | -- This illustrates the use of macros to pass command-line arguments to programs 2 | -- Here both the name of the input file and the parameter of the [scale] actor 3 | -- will be passed on the command line when compiling the program 4 | 5 | #include "dc.cph" 6 | 7 | actor scale (k:unsigned<8>) 8 | in (a:unsigned<8> dc) 9 | out (c:unsigned<8> dc) 10 | rules a -> c 11 | | '< -> '< 12 | | 'p -> 'p*k 13 | | '> -> '> 14 | ; 15 | 16 | stream i:unsigned<8> dc from %ifile; 17 | stream o:unsigned<8> dc to "result.txt"; 18 | 19 | net o = scale %thr i; 20 | 21 | -------------------------------------------------------------------------------- /examples/working/misc/macro/main.proj: -------------------------------------------------------------------------------- 1 | DOT_OPTS = -D ifile=sample.txt -D thr=2 2 | SIM_OPTS = -abbrev_dc_ctors -D ifile=sample.txt -D thr=2 3 | SC_OPTS = -D ifile=sample.txt -D thr=2 -sc_stop_time 100 -sc_abbrev_dc_ctors 4 | VHDL_OPTS = -D ifile=sample.txt -D thr=2 5 | GHDL_RUN_OPTS = --stop-time=300ns 6 | 7 | -------------------------------------------------------------------------------- /examples/working/misc/macro/sample.txt: -------------------------------------------------------------------------------- 1 | < 10 20 30 40 80 > 2 | -------------------------------------------------------------------------------- /examples/working/misc/mhume/main.proj: -------------------------------------------------------------------------------- 1 | DOT_OPTS = -dump_fsms 2 | SIM_OPTS = -abbrev_dc_ctors 3 | SC_OPTS = -sc_stop_time 800 -sc_stop_when_idle 50 -sc_abbrev_dc_ctors 4 | VHDL_OPTS = 5 | GHDL_RUN_OPTS = --stop-time=800ns 6 | -------------------------------------------------------------------------------- /examples/working/misc/mhume/sample.txt: -------------------------------------------------------------------------------- 1 | 2 3 4 2 | -------------------------------------------------------------------------------- /examples/working/misc/sample/main.cph: -------------------------------------------------------------------------------- 1 | -- sample(n):x_1,x_2,x_3=xn,x_2n,.. 2 | -- This example comes from the "Model of Computation" chapter in the LRM 3 | -- Jul 2017 - JS 4 | 5 | actor sample (n: int) 6 | in (i: $t) 7 | out (o: $t) 8 | var k : {1,..,n} = 1 9 | rules 10 | | i:x when k k:k+1 11 | | i:x when k=n -> (k:1, o:x) 12 | ; 13 | 14 | stream i:signed<8> from "sample.txt"; 15 | stream o1:signed<8> to "result1.txt"; 16 | stream o2:signed<8> to "result2.txt"; 17 | 18 | net o1 = sample 2 i; 19 | net o2 = sample 4 i; 20 | -------------------------------------------------------------------------------- /examples/working/misc/sample/main.proj: -------------------------------------------------------------------------------- 1 | DOT_OPTS = -dump_fsms 2 | SIM_OPTS = 3 | SC_OPTS = -sc_stop_time 200 4 | VHDL_OPTS = 5 | GHDL_RUN_OPTS = --stop-time=300ns 6 | -------------------------------------------------------------------------------- /examples/working/misc/sample/sample.txt: -------------------------------------------------------------------------------- 1 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 2 | -------------------------------------------------------------------------------- /examples/working/misc/suml/main.cph: -------------------------------------------------------------------------------- 1 | #include "dc.cph" 2 | 3 | -- suml 4 | -- SUML: = x1+x2+...+xn 5 | -- Non-recursive wiring version (see ../sumlrec for a recursive version) 6 | -- Jun 11, 2010 - JS 7 | 8 | 9 | -- actor decl section 10 | 11 | actor suml () 12 | in (a:signed<8> dc) 13 | out (c:signed<8>) 14 | var st : {S0,S1} = S0 15 | var s : signed<8> 16 | rules 17 | | (st:S0, a:'<) -> (st:S1, s:0) 18 | | (st:S1, a:'p) -> (s:s+p) 19 | | (st:S1, a:'>) -> (st:S0, c:s) 20 | ; 21 | 22 | -- stream decl section 23 | 24 | stream i:signed<8> dc from "sample.txt"; 25 | stream o:signed<8> to "result.txt"; 26 | 27 | -- network section 28 | 29 | net o = suml i; 30 | -------------------------------------------------------------------------------- /examples/working/misc/suml/main.proj: -------------------------------------------------------------------------------- 1 | DOT_OPTS = -infer_mocs -dump_boxes -absint 3 -ai_max_cycles 8 -dump_fsms 2 | SIM_OPTS = -abbrev_dc_ctors 3 | SC_OPTS = -sc_stop_time 200 -sc_abbrev_dc_ctors 4 | VHDL_OPTS = 5 | GHDL_RUN_OPTS = --stop-time=300ns 6 | -------------------------------------------------------------------------------- /examples/working/misc/suml/sample.txt: -------------------------------------------------------------------------------- 1 | < 1 2 3 > < 1 2 3 4 > 2 | -------------------------------------------------------------------------------- /examples/working/misc/sumlrec/main.cph: -------------------------------------------------------------------------------- 1 | -- suml 2 | -- SUML: = x1+x2+...+xn 3 | -- Recursive wiring version (see ../suml for a non-recursive version) 4 | -- Dec 25, 2012 - JS 5 | 6 | #include "dc.cph" 7 | 8 | actor suml 9 | in (a:signed<8> dc, s:signed<16>) 10 | out (c:signed<16>, ss:signed<16>) 11 | rules 12 | | (a:'< ) -> ss:0 13 | | (a:'>, s:s) -> c:s 14 | | (a:'v, s:s) -> ss:s+(v:signed<16>) 15 | ; 16 | 17 | stream i : signed<8> dc from "sample.txt"; 18 | stream o : signed<16> to "result.txt"; 19 | 20 | net o = 21 | let rec (y,z) = suml (i,z) in 22 | y; 23 | -------------------------------------------------------------------------------- /examples/working/misc/sumlrec/main.proj: -------------------------------------------------------------------------------- 1 | DOT_OPTS = -suppress_cast_warnings 2 | SIM_OPTS = -abbrev_dc_ctors -suppress_cast_warnings 3 | SC_OPTS = -sc_stop_time 200 -sc_abbrev_dc_ctors -suppress_cast_warnings 4 | VHDL_OPTS = -suppress_cast_warnings 5 | GHDL_RUN_OPTS = --stop-time=300ns 6 | -------------------------------------------------------------------------------- /examples/working/misc/sumlrec/sample.txt: -------------------------------------------------------------------------------- 1 | < 1 2 3 > < 1 2 3 4 > 2 | -------------------------------------------------------------------------------- /examples/working/misc/sumn/main.cph: -------------------------------------------------------------------------------- 1 | -- SUM(n):x1,...,xn,xn+1,...,x2n,...=x1+...+xn,xn+1+...+x2n,... 2 | -- Jan 23, 2012 - JS 3 | -- 4 | 5 | actor sumn (n : unsigned<4>) 6 | in (a:signed<8>) 7 | out (c:signed<8>) 8 | var k : unsigned<4> = 0 9 | var s : signed<8> = 0 10 | rules 11 | | a:v when k=n -> (k:1, s:v, c:s) 12 | | a:v -> (k:k+1, s:s+v) 13 | ; 14 | 15 | stream i:signed<8> from "sample.txt"; 16 | stream o:signed<8> to "result.txt"; 17 | 18 | net o = sumn 4 i; 19 | -------------------------------------------------------------------------------- /examples/working/misc/sumn/main.proj: -------------------------------------------------------------------------------- 1 | SIM_OPTS = -abbrev_dc_ctors -dump_fsms 2 | SC_OPTS = -sc_stop_time 200 -sc_abbrev_dc_ctors 3 | VHDL_OPTS = 4 | GHDL_RUN_OPTS = --stop-time=300ns 5 | -------------------------------------------------------------------------------- /examples/working/misc/sumn/sample.txt: -------------------------------------------------------------------------------- 1 | 1 2 3 4 5 6 7 8 1 2 3 4 5 6 7 8 2 | -------------------------------------------------------------------------------- /examples/working/misc/thrd/main.proj: -------------------------------------------------------------------------------- 1 | DOT_OPTS = -D period=4 2 | SIM_OPTS = -abbrev_dc_ctors -D period=4 3 | SC_OPTS = -sc_stop_time 200 -sc_abbrev_dc_ctors -D period=4 4 | VHDL_OPTS = -D period=4 5 | GHDL_RUN_OPTS = --stop-time=400ns 6 | -------------------------------------------------------------------------------- /examples/working/misc/thrd/sample1.txt: -------------------------------------------------------------------------------- 1 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 2 | -------------------------------------------------------------------------------- /examples/working/misc/thrd/sample2.txt: -------------------------------------------------------------------------------- 1 | 1 3 2 4 8 10 1 3 2 4 8 10 2 | -------------------------------------------------------------------------------- /examples/working/moc/mocs/main.proj: -------------------------------------------------------------------------------- 1 | DOT_OPTS = -infer_mocs -dot_show_indexes -absint 8 -dump_fsms 2 | SIM_OPTS = -abbrev_dc_ctors 3 | SC_OPTS = -sc_stop_time 200 -sc_abbrev_dc_ctors -sc_dump_fifo_stats 4 | VHDL_OPTS = -vhdl_annot_file ./systemc/fifo_stats.dat 5 | GHDL_RUN_OPTS = --stop-time=400ns 6 | -------------------------------------------------------------------------------- /examples/working/moc/mocs/sample.txt: -------------------------------------------------------------------------------- 1 | < 1 2 3 > < 1 2 3 4 > 2 | -------------------------------------------------------------------------------- /examples/working/moc/mocs/sample1.txt: -------------------------------------------------------------------------------- 1 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 2 | -------------------------------------------------------------------------------- /examples/working/moc/mocs/sample2.txt: -------------------------------------------------------------------------------- 1 | true false true false true false true false 2 | -------------------------------------------------------------------------------- /examples/working/moc/sdfsz/main.cph: -------------------------------------------------------------------------------- 1 | -- This is the program given at the end of the "Model of Computation" chapter 2 | -- in the LRM to illustrate the static computation of FIFO sizes for pure SDF graphs. 3 | -- Note the actual computations (as opposed to their "external behavior") is irrelevant here. 4 | -- Jul 2017, JS 5 | 6 | actor foo 7 | in (i:signed<8>) 8 | out (o:signed<8>) 9 | rules 10 | | i:x -> o:x 11 | ; 12 | 13 | actor bar 14 | in (i1:signed<8>, i2:signed<8>) 15 | out (o:signed<8>) 16 | rules 17 | | (i1:x1, i2:x2)-> o:x1+x2 18 | ; 19 | 20 | actor zib 21 | in (i:signed<8>) 22 | out (o1:signed<8>, o2:signed<8>) 23 | rules 24 | | i:x-> (o1:x, o2:x) 25 | ; 26 | 27 | stream inp:signed<8> from "sample.txt"; 28 | stream outp:signed<8> to "result.txt"; 29 | 30 | net (x2,x3) = zib inp; 31 | net outp = bar (foo inp, bar (foo x2, foo (foo x3))); 32 | -------------------------------------------------------------------------------- /examples/working/moc/sdfsz/main.proj: -------------------------------------------------------------------------------- 1 | DOT_OPTS = -dump_sdf_fifo_sizes -dot_wire_annots -dot_unboxed_ios -dot_simple_boxes 2 | SIM_OPTS = -abbrev_dc_ctors -trace -dump_channel_stats 3 | SC_OPTS = -sc_stop_time 400 -sc_abbrev_dc_ctors -sc_dump_fifo_stats -sc_dump_fifos 4 | VHDL_OPTS = -vhdl_annot_file ./systemc/fifo_stats.dat -vhdl_fifo_model_threshold 8 -vhdl_fifo_offset 2 5 | GHDL_RUN_OPTS = --stop-time=400ns 6 | -------------------------------------------------------------------------------- /examples/working/moc/sdfsz/sample.txt: -------------------------------------------------------------------------------- 1 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 2 | -------------------------------------------------------------------------------- /examples/working/network/chain/main.cph: -------------------------------------------------------------------------------- 1 | -- A basic example with the [chain] higher-order wiring primitive 2 | -- Jul 31, 2015, JS 3 | 4 | actor double 5 | in (a:unsigned<8>) 6 | out (c:unsigned<8>) 7 | rules a -> c 8 | | x -> 2*x 9 | ; 10 | 11 | actor incr 12 | in (a:unsigned<8>) 13 | out (c:unsigned<8>) 14 | rules a -> c 15 | | x -> x+1 16 | ; 17 | 18 | stream i:unsigned<8> from "sample.txt"; 19 | stream o1:unsigned<8> to "result1.txt"; 20 | stream o2:unsigned<8> to "result2.txt"; 21 | stream o3:unsigned<8> to "result3.txt"; 22 | stream o4:unsigned<8> to "result4.txt"; 23 | 24 | net (o1,o2,o3,o4) = chain 4 double i; 25 | -------------------------------------------------------------------------------- /examples/working/network/chain/main.proj: -------------------------------------------------------------------------------- 1 | DOT_OPTS = 2 | SIM_OPTS = 3 | SC_OPTS = -sc_stop_time 400 4 | VHDL_OPTS = 5 | GHDL_RUN_OPTS = --stop-time=200ns 6 | -------------------------------------------------------------------------------- /examples/working/network/chain/sample.txt: -------------------------------------------------------------------------------- 1 | 0 1 2 3 2 | -------------------------------------------------------------------------------- /examples/working/network/compose1/main.cph: -------------------------------------------------------------------------------- 1 | -- The compose higher-order wiring function 2 | 3 | type byte == unsigned<8>; 4 | 5 | actor add1 in (a:byte) out (c:byte) rules | a:x -> c:x+1; 6 | actor mul2 in (a:byte) out (c:byte) rules | a:x -> c:(x*2:unsigned<8>); 7 | 8 | stream i : byte from "sample.txt"; 9 | stream o : byte to "result.txt"; 10 | 11 | net compose f g x = g (f x); 12 | 13 | net o = compose add1 mul2 i; 14 | -------------------------------------------------------------------------------- /examples/working/network/compose1/main.proj: -------------------------------------------------------------------------------- 1 | SIM_OPTS = -abbrev_dc_ctors 2 | SC_OPTS = -sc_stop_time 100 -sc_abbrev_dc_ctors 3 | VHDL_OPTS = 4 | GHDL_RUN_OPTS = --stop-time=200ns 5 | -------------------------------------------------------------------------------- /examples/working/network/compose1/sample.txt: -------------------------------------------------------------------------------- 1 | 1 2 3 4 5 6 2 | -------------------------------------------------------------------------------- /examples/working/network/compose2/main.cph: -------------------------------------------------------------------------------- 1 | -- An example with the [compose] higher-order wiring function showing that the 2 | -- intermediate value does not have to have a scalar type 3 | -- Dec 1, 2015, JS 4 | 5 | actor foo 6 | in (a:unsigned<8>) 7 | out (c1:unsigned<8>,c2:signed<4>) 8 | rules a -> (c1,c2) 9 | | x -> (2*x,(x+1:signed<4>)) 10 | ; 11 | 12 | actor bar 13 | in (a1:unsigned<8>, a2:signed<4>) 14 | out (c:unsigned<8>) 15 | rules (a1,a2) -> c 16 | | (x,y) -> x+(y:unsigned<8>) 17 | ; 18 | 19 | net compose f g x = g (f x); 20 | 21 | stream i:unsigned<8> from "sample.txt"; 22 | stream o:unsigned<8> to "result.txt"; 23 | 24 | net o = compose foo bar i; 25 | -------------------------------------------------------------------------------- /examples/working/network/compose2/main.proj: -------------------------------------------------------------------------------- 1 | SIM_OPTS = -suppress_cast_warnings 2 | SC_OPTS = -sc_stop_time 100 -sc_abbrev_dc_ctors 3 | VHDL_OPTS = 4 | GHDL_RUN_OPTS = --stop-time=200ns 5 | -------------------------------------------------------------------------------- /examples/working/network/compose2/sample.txt: -------------------------------------------------------------------------------- 1 | 0 1 2 3 2 | -------------------------------------------------------------------------------- /examples/working/network/cond/main.proj: -------------------------------------------------------------------------------- 1 | SIM_OPTS = 2 | SC_OPTS = -sc_stop_time 400 -sc_dump_fifo_stats 3 | VHDL_OPTS = -vhdl_annot_file ./systemc/fifo_stats.dat 4 | GHDL_RUN_OPTS = --stop-time=1200ns 5 | -------------------------------------------------------------------------------- /examples/working/network/cond/sample.txt: -------------------------------------------------------------------------------- 1 | 1 2 3 4 5 6 7 8 2 | -------------------------------------------------------------------------------- /examples/working/network/diamond/main.cph: -------------------------------------------------------------------------------- 1 | -- The diamond higher-order wiring function 2 | 3 | type byte == unsigned<8>; 4 | 5 | actor f in (a:byte) out (c:byte,d:byte) rules | a:x -> (c:x,d:x); 6 | actor g in (a:byte) out (c:byte) rules | a:x -> c:x+1; 7 | actor h in (a:byte,b:byte) out (c:byte) rules | (a:x,b:y) -> c:(x*y:byte); 8 | 9 | stream i : byte from "sample.txt"; 10 | stream o : byte to "result.txt"; 11 | 12 | net diamond (top,middle,bottom) v = 13 | let (x,y) = top v in 14 | bottom (middle x, middle y) 15 | ; 16 | 17 | net o = diamond (f,g,h) i; 18 | -------------------------------------------------------------------------------- /examples/working/network/diamond/main.proj: -------------------------------------------------------------------------------- 1 | SIM_OPTS = -abbrev_dc_ctors 2 | SC_OPTS = -sc_stop_time 100 -sc_abbrev_dc_ctors 3 | VHDL_OPTS = 4 | GHDL_RUN_OPTS = --stop-time=200ns 5 | -------------------------------------------------------------------------------- /examples/working/network/diamond/sample.txt: -------------------------------------------------------------------------------- 1 | 1 2 3 4 5 6 2 | -------------------------------------------------------------------------------- /examples/working/network/diamonds/main.cph: -------------------------------------------------------------------------------- 1 | -- The diamond higher-order wiring function 2 | 3 | type byte == unsigned<31>; 4 | 5 | actor f in (a:byte) out (c:byte,d:byte) rules | a:x -> (c:x,d:x); 6 | actor g in (a:byte) out (c:byte) rules | a:x -> c:x+1; 7 | actor h in (a:byte,b:byte) out (c:byte) rules | (a:x,b:y) -> c:(x*y:byte); 8 | 9 | stream i : byte from "sample.txt"; 10 | stream o : byte to "result.txt"; 11 | 12 | net diamond (top,middle,bottom) v = 13 | let (x,y) = top v in 14 | bottom (middle x, middle y) 15 | ; 16 | 17 | net o = diamond (f, diamond (f, diamond (f,g,h), h), h) i; 18 | -------------------------------------------------------------------------------- /examples/working/network/diamonds/main.proj: -------------------------------------------------------------------------------- 1 | SIM_OPTS = -abbrev_dc_ctors 2 | SC_OPTS = -sc_stop_time 800 -sc_abbrev_dc_ctors 3 | VHDL_OPTS = 4 | GHDL_RUN_OPTS = --stop-time=800ns 5 | -------------------------------------------------------------------------------- /examples/working/network/diamonds/sample.txt: -------------------------------------------------------------------------------- 1 | 1 2 3 4 5 6 2 | -------------------------------------------------------------------------------- /examples/working/network/filter_bank/main.cph: -------------------------------------------------------------------------------- 1 | #include "convol.cph" 2 | 3 | const kernels = [ 4 | [1,2,1], 5 | [1,3,1], 6 | [1,4,1], 7 | [1,5,1] 8 | ] : unsigned<8> array[4][3]; 9 | 10 | actor combine 11 | in (i1:unsigned<8> dc, i2:unsigned<8> dc, i3:unsigned<8> dc, i4:unsigned<8> dc) 12 | out (o:unsigned<8> dc) 13 | rules (i1,i2,i3,i4) -> o 14 | | ('<,'<,'<,'<) -> '< 15 | | ('>,'>,'>,'>) -> '> 16 | | ('x1,'x2,'x3,'x4) -> '(x1+x2+x3+x3)>>2 -- More clever combination strategies should be used in practice ! 17 | ; 18 | 19 | stream i:unsigned<8> dc from "sample.txt"; 20 | stream o:unsigned<8> dc to "result.txt"; 21 | 22 | net f i x = conv113 ((kernels[i]),2,0) x; -- the [conv113a] actor is defined in "convol.cph" 23 | 24 | net o = combine (mapi f (i,i,i,i)); 25 | 26 | -------------------------------------------------------------------------------- /examples/working/network/filter_bank/main.proj: -------------------------------------------------------------------------------- 1 | SIM_OPTS = -abbrev_dc_ctors -I ../../../../lib/caph 2 | SC_OPTS = -I ../../../../lib/caph -sc_stop_time 400 -sc_abbrev_dc_ctors # 3 | VHDL_OPTS = -I ../../../../lib/caph 4 | GHDL_RUN_OPTS = --stop-time=600ns 5 | -------------------------------------------------------------------------------- /examples/working/network/filter_bank/sample.txt: -------------------------------------------------------------------------------- 1 | < 1 2 3 4 1 2 3 4 1 2 3 4 1 2 3 4 > 2 | -------------------------------------------------------------------------------- /examples/working/network/foldl/main.cph: -------------------------------------------------------------------------------- 1 | -- Example showing to use the [foldl] higher-order wiring primitive to describe 2 | -- a dyadic reduction graph pattern 3 | -- Updated May 7, 2019 - JS 4 | 5 | actor add 6 | in (a:unsigned<8>, b:unsigned<8>) 7 | out (c:unsigned<8>) 8 | rules (a,b) -> c 9 | | (x,y) -> x+y 10 | ; 11 | 12 | stream i1:unsigned<8> from "sample.txt"; 13 | stream i2:unsigned<8> from "sample.txt"; 14 | stream i3:unsigned<8> from "sample.txt"; 15 | stream i4:unsigned<8> from "sample.txt"; 16 | stream o:unsigned<8> to "result.txt"; 17 | 18 | net o = foldl add i1 (i2,i3,i4); 19 | -------------------------------------------------------------------------------- /examples/working/network/foldl/main.proj: -------------------------------------------------------------------------------- 1 | DOT_OPTS = 2 | SIM_OPTS = 3 | SC_OPTS = -sc_stop_time 100 -sc_abbrev_dc_ctors 4 | VHDL_OPTS = 5 | GHDL_RUN_OPTS = --stop-time=200ns 6 | -------------------------------------------------------------------------------- /examples/working/network/foldl/sample.txt: -------------------------------------------------------------------------------- 1 | 0 1 2 3 2 | -------------------------------------------------------------------------------- /examples/working/network/foldli/main.cph: -------------------------------------------------------------------------------- 1 | -- Example showing to use the [foldli] higher-order wiring primitive to describe 2 | -- an indexed dyadic reduction graph pattern 3 | -- For each quadruplet of inputs [(i1,i2,i3,i4)], the output is [((i1*c1+i2)*c2+i3)*c3+i4] 4 | -- Jul 15, 2015 - JS 5 | 6 | const c = [1,2,3] : unsigned<8> array[3]; 7 | 8 | actor madd (k: unsigned<8>) 9 | in (i1:unsigned<8>, i2:unsigned<8>) 10 | out (o:unsigned<8>) 11 | rules (i1,i2) -> o 12 | | (x,y) -> x*c[k]+y 13 | ; 14 | 15 | stream i1:unsigned<8> from "sample.txt"; 16 | stream i2:unsigned<8> from "sample.txt"; 17 | stream i3:unsigned<8> from "sample.txt"; 18 | stream i4:unsigned<8> from "sample.txt"; 19 | stream o:unsigned<8> to "result.txt"; 20 | 21 | net o = foldli madd i1 (i2,i3,i4); 22 | -------------------------------------------------------------------------------- /examples/working/network/foldli/main.proj: -------------------------------------------------------------------------------- 1 | DOT_OPTS = 2 | SIM_OPTS = 3 | SC_OPTS = -sc_stop_time 100 4 | VHDL_OPTS = 5 | GHDL_RUN_OPTS = --stop-time=200ns 6 | -------------------------------------------------------------------------------- /examples/working/network/foldli/sample.txt: -------------------------------------------------------------------------------- 1 | 0 1 2 3 2 | -------------------------------------------------------------------------------- /examples/working/network/foldmap/main.proj: -------------------------------------------------------------------------------- 1 | SIM_OPTS = -suppress_cast_warnings 2 | SC_OPTS = -sc_stop_time 200 3 | VHDL_OPTS = 4 | GHDL_RUN_OPTS = --stop-time=200ns 5 | -------------------------------------------------------------------------------- /examples/working/network/foldmap/main.rules: -------------------------------------------------------------------------------- 1 | z.bin: ../z.txt 2 | $(TXT2BIN) -eventf uint 8 $< > $@ 3 | -------------------------------------------------------------------------------- /examples/working/network/foldmap/sample.txt: -------------------------------------------------------------------------------- 1 | 0 1 2 3 2 | -------------------------------------------------------------------------------- /examples/working/network/foldmap/z.txt: -------------------------------------------------------------------------------- 1 | # sim_cycle sc_time vhdl_time value 2 | 0 0 0 10 3 | -------------------------------------------------------------------------------- /examples/working/network/foldt/main.cph: -------------------------------------------------------------------------------- 1 | -- Example showing to use the [foldt] higher-order wiring primitive to describe 2 | -- a dyadic reduction graph pattern 3 | -- Jul 31, 2015 - JS 4 | 5 | actor add 6 | in (a:unsigned<8>, b:unsigned<8>) 7 | out (c:unsigned<8>) 8 | rules (a,b) -> c 9 | | (x,y) -> x+y 10 | ; 11 | 12 | stream i1:unsigned<8> from "sample.txt"; 13 | stream i2:unsigned<8> from "sample.txt"; 14 | stream i3:unsigned<8> from "sample.txt"; 15 | stream i4:unsigned<8> from "sample.txt"; 16 | stream o:unsigned<8> to "result.txt"; 17 | 18 | net o = foldt add (i1,i2,i3,i4); 19 | -------------------------------------------------------------------------------- /examples/working/network/foldt/main.proj: -------------------------------------------------------------------------------- 1 | SIM_OPTS = 2 | SC_OPTS = -sc_stop_time 100 -sc_abbrev_dc_ctors 3 | VHDL_OPTS = 4 | GHDL_RUN_OPTS = --stop-time=200ns 5 | -------------------------------------------------------------------------------- /examples/working/network/foldt/sample.txt: -------------------------------------------------------------------------------- 1 | 0 1 2 3 2 | -------------------------------------------------------------------------------- /examples/working/network/map2/main.cph: -------------------------------------------------------------------------------- 1 | -- A basic example with the [map2] higher-order wiring primitive 2 | -- May 16, 2014, JS 3 | 4 | actor add (k:unsigned<8>) 5 | in (a:unsigned<8>, b:unsigned<8>) 6 | out (c:unsigned<8>) 7 | rules (a,b) -> c 8 | | (x,y) -> k*x+y 9 | ; 10 | 11 | stream i11:unsigned<8> from "sample.txt"; 12 | stream i12:unsigned<8> from "sample.txt"; 13 | stream i21:unsigned<8> from "sample.txt"; 14 | stream i22:unsigned<8> from "sample.txt"; 15 | stream o1:unsigned<8> to "result1.txt"; 16 | stream o2:unsigned<8> to "result2.txt"; 17 | 18 | net f (x,y) = add 2 (x,y); 19 | 20 | net (o1,o2) = map2 f ((i11,i12),(i21,i22)); 21 | -------------------------------------------------------------------------------- /examples/working/network/map2/main.proj: -------------------------------------------------------------------------------- 1 | SIM_OPTS = 2 | SC_OPTS = -sc_stop_time 100 -sc_abbrev_dc_ctors 3 | VHDL_OPTS = 4 | GHDL_RUN_OPTS = --stop-time=200ns 5 | -------------------------------------------------------------------------------- /examples/working/network/map2/sample.txt: -------------------------------------------------------------------------------- 1 | 0 1 2 3 2 | -------------------------------------------------------------------------------- /examples/working/network/map2i/main.cph: -------------------------------------------------------------------------------- 1 | -- A basic example with the [map2i] higher-order wiring primitive 2 | -- May 16, 2014, JS 3 | 4 | const coeff = [2,4] : unsigned<8> array[2]; 5 | 6 | actor add (k:unsigned<8>) 7 | in (a:unsigned<8>, b:unsigned<8>) 8 | out (c:unsigned<8>) 9 | rules (a,b) -> c 10 | | (x,y) -> k*x+y 11 | ; 12 | 13 | stream i11:unsigned<8> from "sample.txt"; 14 | stream i12:unsigned<8> from "sample.txt"; 15 | stream i21:unsigned<8> from "sample.txt"; 16 | stream i22:unsigned<8> from "sample.txt"; 17 | stream o1:unsigned<8> to "result1.txt"; 18 | stream o2:unsigned<8> to "result2.txt"; 19 | 20 | net f i (x,y) = add (coeff[i]) (x,y); 21 | 22 | net (o1,o2) = map2i f ((i11,i12),(i21,i22)); 23 | -------------------------------------------------------------------------------- /examples/working/network/map2i/main.proj: -------------------------------------------------------------------------------- 1 | SIM_OPTS = 2 | SC_OPTS = -sc_stop_time 100 -sc_abbrev_dc_ctors 3 | VHDL_OPTS = 4 | GHDL_RUN_OPTS = --stop-time=200ns 5 | -------------------------------------------------------------------------------- /examples/working/network/map2i/sample.txt: -------------------------------------------------------------------------------- 1 | 0 1 2 3 2 | -------------------------------------------------------------------------------- /examples/working/network/map_1/main.cph: -------------------------------------------------------------------------------- 1 | -- A basic example with the [map] higher-order wiring primitive 2 | -- Here, the first argument is a simple actor 3 | -- May 16, 2014, JS 4 | 5 | actor double 6 | in (a:unsigned<8>) 7 | out (c:unsigned<8>) 8 | rules a -> c 9 | | x -> 2*x 10 | ; 11 | 12 | stream i1:unsigned<8> from "sample.txt"; 13 | stream i2:unsigned<8> from "sample.txt"; 14 | stream o1:unsigned<8> to "result1.txt"; 15 | stream o2:unsigned<8> to "result2.txt"; 16 | 17 | net (o1,o2) = map double (i1,i2); 18 | -------------------------------------------------------------------------------- /examples/working/network/map_1/main.proj: -------------------------------------------------------------------------------- 1 | SIM_OPTS = 2 | SC_OPTS = -sc_stop_time 100 -sc_abbrev_dc_ctors 3 | VHDL_OPTS = 4 | GHDL_RUN_OPTS = --stop-time=200ns 5 | -------------------------------------------------------------------------------- /examples/working/network/map_1/sample.txt: -------------------------------------------------------------------------------- 1 | 0 1 2 3 2 | -------------------------------------------------------------------------------- /examples/working/network/map_2/main.cph: -------------------------------------------------------------------------------- 1 | -- A basic example with the [map] higher-order wiring primitive 2 | -- Here, the first argument is an actor accepting a parameter 3 | -- May 16, 2014, JS 4 | 5 | actor scale (k:unsigned<8>) 6 | in (a:unsigned<8>) 7 | out (c:unsigned<8>) 8 | rules a -> c 9 | | x -> 2*x 10 | ; 11 | 12 | stream i1:unsigned<8> from "sample.txt"; 13 | stream i2:unsigned<8> from "sample.txt"; 14 | stream o1:unsigned<8> to "result1.txt"; 15 | stream o2:unsigned<8> to "result2.txt"; 16 | 17 | net (o1,o2) = map (scale 2) (i1,i2); 18 | -------------------------------------------------------------------------------- /examples/working/network/map_2/main.proj: -------------------------------------------------------------------------------- 1 | SIM_OPTS = 2 | SC_OPTS = -sc_stop_time 100 -sc_abbrev_dc_ctors 3 | VHDL_OPTS = 4 | GHDL_RUN_OPTS = --stop-time=200ns 5 | -------------------------------------------------------------------------------- /examples/working/network/map_2/sample.txt: -------------------------------------------------------------------------------- 1 | 0 1 2 3 2 | -------------------------------------------------------------------------------- /examples/working/network/map_3/main.cph: -------------------------------------------------------------------------------- 1 | -- A basic example with the [map] higher-order wiring primitive 2 | -- Here, the first argument is a wiring function 3 | -- May 16, 2014, JS 4 | 5 | actor scale (k:unsigned<8>) 6 | in (a:unsigned<8>) 7 | out (c:unsigned<8>) 8 | rules a -> c 9 | | x -> 2*x 10 | ; 11 | 12 | stream i1:unsigned<8> from "sample.txt"; 13 | stream i2:unsigned<8> from "sample.txt"; 14 | stream o1:unsigned<8> to "result1.txt"; 15 | stream o2:unsigned<8> to "result2.txt"; 16 | 17 | net double x = scale 2 x; 18 | 19 | net (o1,o2) = map double (i1,i2); 20 | -------------------------------------------------------------------------------- /examples/working/network/map_3/main.proj: -------------------------------------------------------------------------------- 1 | SIM_OPTS = 2 | SC_OPTS = -sc_stop_time 100 -sc_abbrev_dc_ctors 3 | VHDL_OPTS = 4 | GHDL_RUN_OPTS = --stop-time=200ns 5 | -------------------------------------------------------------------------------- /examples/working/network/map_3/sample.txt: -------------------------------------------------------------------------------- 1 | 0 1 2 3 2 | -------------------------------------------------------------------------------- /examples/working/network/mapi/main.cph: -------------------------------------------------------------------------------- 1 | -- A basic example with the [mapi] higher-order wiring primitive 2 | -- May 16, 2014, JS 3 | 4 | const coeff = [2,4,8,16] : unsigned<8> array[4]; 5 | 6 | actor scale (k:unsigned<8>) 7 | in (a:unsigned<8>) 8 | out (c:unsigned<8>) 9 | rules a -> c 10 | | x -> k*x 11 | ; 12 | 13 | stream i:unsigned<8> from "sample.txt"; 14 | stream o1:unsigned<8> to "result1.txt"; 15 | stream o2:unsigned<8> to "result2.txt"; 16 | stream o3:unsigned<8> to "result3.txt"; 17 | stream o4:unsigned<8> to "result4.txt"; 18 | 19 | net f i x = scale (coeff[i]) x; 20 | 21 | net (o1,o2,o3,o4) = mapi f (i,i,i,i); 22 | -------------------------------------------------------------------------------- /examples/working/network/mapi/main.proj: -------------------------------------------------------------------------------- 1 | SIM_OPTS = 2 | SC_OPTS = -sc_stop_time 100 -sc_abbrev_dc_ctors 3 | VHDL_OPTS = 4 | GHDL_RUN_OPTS = --stop-time=200ns 5 | -------------------------------------------------------------------------------- /examples/working/network/mapi/sample.txt: -------------------------------------------------------------------------------- 1 | 0 1 2 3 2 | -------------------------------------------------------------------------------- /examples/working/network/msfl33/main.proj: -------------------------------------------------------------------------------- 1 | SIM_OPTS = -abbrev_dc_ctors 2 | SC_OPTS = -sc_stop_time 600 -sc_abbrev_dc_ctors -sc_dump_fifo_stats 3 | VHDL_OPTS = -vhdl_annot_file ./systemc/fifo_stats.dat 4 | GHDL_RUN_OPTS = --stop-time=1200ns 5 | -------------------------------------------------------------------------------- /examples/working/network/msfl33/sample.txt: -------------------------------------------------------------------------------- 1 | < < 11 12 13 14 15 > < 21 22 23 24 25 > < 31 32 33 34 35 > < 41 42 43 44 45 > < 51 52 53 54 55 > > 2 | -------------------------------------------------------------------------------- /examples/working/network/mutrec/main.proj: -------------------------------------------------------------------------------- 1 | SIM_OPTS = -abbrev_dc_ctors 2 | SC_OPTS = -sc_stop_time 200 -sc_abbrev_dc_ctors 3 | VHDL_OPTS = 4 | GHDL_RUN_OPTS = --stop-time=400ns 5 | -------------------------------------------------------------------------------- /examples/working/network/mutrec/sample1.txt: -------------------------------------------------------------------------------- 1 | 1 2 3 4 2 | -------------------------------------------------------------------------------- /examples/working/network/mutrec/sample2.txt: -------------------------------------------------------------------------------- 1 | 1 2 3 4 2 | -------------------------------------------------------------------------------- /examples/working/network/napp1/main.cph: -------------------------------------------------------------------------------- 1 | -- A basic example with the [napp] higher-order wiring primitive 2 | -- Dec 8, 2015, JS 3 | 4 | actor double 5 | in (i:unsigned<8>) 6 | out (o:unsigned<8>) 7 | rules 8 | | i:x -> o:2*x 9 | ; 10 | 11 | stream i:unsigned<8> from "sample.txt"; 12 | stream o1:unsigned<8> to "result1.txt"; 13 | stream o2:unsigned<8> to "result2.txt"; 14 | stream o3:unsigned<8> to "result3.txt"; 15 | 16 | net (o1,o2,o3) = napp 3 double i; 17 | -------------------------------------------------------------------------------- /examples/working/network/napp1/main.proj: -------------------------------------------------------------------------------- 1 | DOT_OPTS = -dot_unboxed_ios -dot_simple_boxes 2 | SIM_OPTS = -suppress_cast_warnings 3 | SC_OPTS = -sc_stop_time 100 4 | VHDL_OPTS = 5 | GHDL_RUN_OPTS = --stop-time=200ns 6 | -------------------------------------------------------------------------------- /examples/working/network/napp1/sample.txt: -------------------------------------------------------------------------------- 1 | 0 1 2 3 2 | -------------------------------------------------------------------------------- /examples/working/network/napp2/main.cph: -------------------------------------------------------------------------------- 1 | -- Another example with the [napp] higher-order wiring primitive 2 | -- Here, the pair of wires [(i1,i2)] is broadcasted to a row of [n] (here n=2) [addm] actors, 3 | -- Dec 8, 2015, JS 4 | 5 | actor addm 6 | in (i1:unsigned<8>, i2:unsigned<8>) 7 | out (o:unsigned<8>) 8 | rules 9 | | (i1:x1, i2:x2) -> o:x1+x2 10 | ; 11 | 12 | stream i1:unsigned<8> from "sample.txt"; 13 | stream i2:unsigned<8> from "sample.txt"; 14 | stream o1:unsigned<8> to "result1.txt"; 15 | stream o2:unsigned<8> to "result2.txt"; 16 | 17 | net (o1,o2) = napp 2 addm (i1,i2); 18 | -------------------------------------------------------------------------------- /examples/working/network/napp2/main.proj: -------------------------------------------------------------------------------- 1 | DOT_OPTS = -dot_unboxed_ios -dot_simple_boxes -dump_tenv 2 | SIM_OPTS = -suppress_cast_warnings 3 | SC_OPTS = -sc_stop_time 100 4 | VHDL_OPTS = 5 | GHDL_RUN_OPTS = --stop-time=200ns 6 | -------------------------------------------------------------------------------- /examples/working/network/napp2/sample.txt: -------------------------------------------------------------------------------- 1 | 0 1 2 3 2 | -------------------------------------------------------------------------------- /examples/working/network/nappi/main.cph: -------------------------------------------------------------------------------- 1 | -- A basic example with the [nappi] higher-order wiring primitive 2 | -- Dec 8, 2015, JS 3 | 4 | actor scale (k: unsigned<8>) 5 | in (i:unsigned<8>) 6 | out (o:unsigned<8>) 7 | rules 8 | | i:x -> o:(k+1)*x 9 | ; 10 | 11 | stream i:unsigned<8> from "sample.txt"; 12 | stream o1:unsigned<8> to "result1.txt"; 13 | stream o2:unsigned<8> to "result2.txt"; 14 | stream o3:unsigned<8> to "result3.txt"; 15 | 16 | net (o1,o2,o3) = nappi 3 scale i; 17 | -------------------------------------------------------------------------------- /examples/working/network/nappi/main.proj: -------------------------------------------------------------------------------- 1 | DOT_OPTS = -dot_unboxed_ios -dot_simple_boxes 2 | SIM_OPTS = -suppress_cast_warnings 3 | SC_OPTS = -sc_stop_time 100 4 | VHDL_OPTS = 5 | GHDL_RUN_OPTS = --stop-time=200ns 6 | -------------------------------------------------------------------------------- /examples/working/network/nappi/sample.txt: -------------------------------------------------------------------------------- 1 | 0 1 2 3 2 | -------------------------------------------------------------------------------- /examples/working/network/pipe/main.cph: -------------------------------------------------------------------------------- 1 | -- A basic example with the [pipe] higher-order wiring primitive 2 | -- Jul 31, 2015, JS 3 | 4 | actor double 5 | in (a:unsigned<8>) 6 | out (c:unsigned<8>) 7 | rules a -> c 8 | | x -> 2*x 9 | ; 10 | 11 | stream i:unsigned<8> from "sample.txt"; 12 | stream o:unsigned<8> to "result.txt"; 13 | 14 | net o = pipe 4 double i; 15 | -------------------------------------------------------------------------------- /examples/working/network/pipe/main.proj: -------------------------------------------------------------------------------- 1 | SIM_OPTS = 2 | SC_OPTS = -sc_stop_time 100 -sc_abbrev_dc_ctors 3 | VHDL_OPTS = 4 | GHDL_RUN_OPTS = --stop-time=200ns 5 | -------------------------------------------------------------------------------- /examples/working/network/pipe/sample.txt: -------------------------------------------------------------------------------- 1 | 0 1 2 3 2 | -------------------------------------------------------------------------------- /examples/working/network/scm/main.cph: -------------------------------------------------------------------------------- 1 | -- Example showing to use the [map] higher-order wiring primitive to describe 2 | -- a split-compute-merge parallel graph pattern 3 | -- May 13, 2014 - JS 4 | 5 | actor compute 6 | in (a:unsigned<8>) 7 | out (c:unsigned<8>) 8 | rules a -> c 9 | | x -> 2*x 10 | ; 11 | 12 | actor split 13 | in (i:unsigned<8>) 14 | out (o1:unsigned<8>,o2:unsigned<8>,o3:unsigned<8>,o4:unsigned<8>) 15 | rules i -> (o1,o2,o3,o4) 16 | | x -> (x,x,x,x) 17 | ; 18 | 19 | actor merge 20 | in (i1:unsigned<8>,i2:unsigned<8>,i3:unsigned<8>,i4:unsigned<8>) 21 | out (o:unsigned<8>) 22 | rules (i1,i2,i3,i4) -> o 23 | | (x1,x2,x3,x4) -> x1+x2+x3+x4 24 | ; 25 | 26 | stream i:unsigned<8> from "sample.txt"; 27 | stream o:unsigned<8> to "result.txt"; 28 | 29 | net scm s c m x = m (map c (split x)); 30 | 31 | net o = scm split compute merge i; 32 | -------------------------------------------------------------------------------- /examples/working/network/scm/main.proj: -------------------------------------------------------------------------------- 1 | SIM_OPTS = 2 | SC_OPTS = -sc_stop_time 100 -sc_abbrev_dc_ctors 3 | VHDL_OPTS = 4 | GHDL_RUN_OPTS = --stop-time=200ns 5 | -------------------------------------------------------------------------------- /examples/working/network/scm/sample.txt: -------------------------------------------------------------------------------- 1 | 0 1 2 3 2 | -------------------------------------------------------------------------------- /examples/working/network/scm2/main.cph: -------------------------------------------------------------------------------- 1 | -- Nested SCM patterns 2 | -- May 16, 2014 - JS 3 | 4 | actor compute 5 | in (a:unsigned<8>) 6 | out (c:unsigned<8>) 7 | rules a -> c 8 | | x -> 2*x 9 | ; 10 | 11 | actor split 12 | in (i:unsigned<8>) 13 | out (o1:unsigned<8>,o2:unsigned<8>,o3:unsigned<8>,o4:unsigned<8>) 14 | rules i -> (o1,o2,o3,o4) 15 | | x -> (x,x,x,x) 16 | ; 17 | 18 | actor merge 19 | in (i1:unsigned<8>,i2:unsigned<8>,i3:unsigned<8>,i4:unsigned<8>) 20 | out (o:unsigned<8>) 21 | rules (i1,i2,i3,i4) -> o 22 | | (x1,x2,x3,x4) -> x1+x2+x3+x4 23 | ; 24 | 25 | stream i:unsigned<8> from "sample.txt"; 26 | stream o:unsigned<8> to "result.txt"; 27 | 28 | net scm s c m x = m (map c (split x)); 29 | 30 | net o = scm split (scm split compute merge) merge i; 31 | -------------------------------------------------------------------------------- /examples/working/network/scm2/main.proj: -------------------------------------------------------------------------------- 1 | SIM_OPTS = 2 | SC_OPTS = -sc_stop_time 100 -sc_abbrev_dc_ctors 3 | VHDL_OPTS = 4 | GHDL_RUN_OPTS = --stop-time=200ns 5 | -------------------------------------------------------------------------------- /examples/working/network/scm2/sample.txt: -------------------------------------------------------------------------------- 1 | 0 1 2 3 2 | -------------------------------------------------------------------------------- /examples/working/network/while/main.proj: -------------------------------------------------------------------------------- 1 | SIM_OPTS = -abbrev_dc_ctors 2 | SC_OPTS = -sc_stop_time 2000 -sc_abbrev_dc_ctors 3 | VHDL_OPTS = 4 | GHDL_RUN_OPTS = --stop-time=3000ns 5 | -------------------------------------------------------------------------------- /examples/working/network/while/sample.txt: -------------------------------------------------------------------------------- 1 | 1 2 3 4 2 | -------------------------------------------------------------------------------- /examples/working/primer/invimg/lena128.pgm: -------------------------------------------------------------------------------- 1 | ../../../imgs/lena128.pgm -------------------------------------------------------------------------------- /examples/working/primer/invimg/main.cph: -------------------------------------------------------------------------------- 1 | #include "dc.cph" 2 | 3 | actor inv () 4 | in (i:unsigned<8> dc) 5 | out (o:unsigned<8> dc) 6 | rules 7 | | i:'< -> o:'< 8 | | i:'> -> o:'> 9 | | i:'x -> o:'255-x 10 | ; 11 | 12 | stream inp:unsigned<8> dc from "lena128.pgm"; 13 | stream outp:unsigned<8> dc to "result.pgm"; 14 | 15 | net outp = inv inp; 16 | -------------------------------------------------------------------------------- /examples/working/primer/invimg/main.procs: -------------------------------------------------------------------------------- 1 | PRE_PROC = pgm2txt -abbrev lena128.pgm lena128.txt 2 | POST_PROC = txt2pgm -abbrev 255 sim/result.txt sim/result.pgm 3 | -------------------------------------------------------------------------------- /examples/working/primer/invimg/main.proj: -------------------------------------------------------------------------------- 1 | DOT_OPTS = 2 | SIM_OPTS = -abbrev_dc_ctors 3 | SC_OPTS = -sc_stop_time 1000000 -sc_abbrev_dc_ctors 4 | VHDL_OPTS = 5 | GHDL_RUN_OPTS = --stop-time=400000ns 6 | -------------------------------------------------------------------------------- /examples/working/primer/simple/main.cph: -------------------------------------------------------------------------------- 1 | -- This is the first example described in the "Caph Primer" tutorial, chapter 1 2 | 3 | 4 | -- Actor declarations 5 | 6 | actor inc 7 | in (i: unsigned<8>) 8 | out (o: unsigned<8>) 9 | rules 10 | | i:x -> o:x+1; 11 | 12 | actor dec 13 | in (i: unsigned<8>) 14 | out (o: unsigned<8>) 15 | rules 16 | | i:x -> o:x-1; 17 | 18 | actor mul 19 | in (i1: unsigned <8>, i2 : unsigned<8>) 20 | out (o: unsigned<8>) 21 | rules 22 | | (i1:x, i2:y) -> o:x*y; 23 | 24 | actor dup 25 | in (i: unsigned<8>) 26 | out (o1: unsigned <8>, o2: unsigned<8>) 27 | rules 28 | | i:x -> (o1:x, o2:x); 29 | 30 | -- I/O declarations 31 | stream inp: unsigned<8> from "sample.txt"; 32 | stream outp: unsigned<8> to "result.txt"; 33 | 34 | -- Network declarations 35 | net (x1, x2) = dup inp; 36 | net y1 = inc x1; 37 | net y2 = dec x2; 38 | net outp = mul (y1, y2); 39 | -------------------------------------------------------------------------------- /examples/working/primer/simple/main.proj: -------------------------------------------------------------------------------- 1 | SC_OPTS = -sc_stop_time 200 2 | GHDL_RUN_OPTS = --stop-time=200ns --vcd=simple_tb.vcd 3 | -------------------------------------------------------------------------------- /examples/working/primer/simple/sample.txt: -------------------------------------------------------------------------------- 1 | 1 2 3 4 5 6 7 8 2 | -------------------------------------------------------------------------------- /examples/working/primer/simple/simple_tb.sav: -------------------------------------------------------------------------------- 1 | [*] 2 | [*] GTKWave Analyzer v3.3.54 (w)1999-2014 BSI 3 | [*] Fri Nov 18 16:56:09 2016 4 | [*] 5 | [dumpfile] "/Users/jserot/Dev/ml/caph/working/examples/working/primer/simple/simple_tb.vcd" 6 | [dumpfile_mtime] "Fri Nov 18 16:55:15 2016" 7 | [dumpfile_size] 13467 8 | [savefile] "/Users/jserot/Dev/ml/caph/working/examples/working/primer/simple/simple_tb.sav" 9 | [timestart] 0 10 | [size] 1000 600 11 | [pos] -1 -1 12 | *-25.870552 -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 -1 13 | [sst_width] 198 14 | [signals_width] 98 15 | [sst_expanded] 1 16 | [sst_vpaned_height] 166 17 | @28 18 | clock 19 | reset 20 | @25 21 | w7[7:0] 22 | @28 23 | w7_f 24 | w7_wr 25 | @25 26 | w18[7:0] 27 | @28 28 | w18_e 29 | w18_rd 30 | [pattern_trace] 1 31 | [pattern_trace] 0 32 | -------------------------------------------------------------------------------- /examples/working/primer/sobel/main.procs: -------------------------------------------------------------------------------- 1 | PRE_PROC = pgm2txt -abbrev pcb.pgm pcb.txt 2 | POST_PROC = txt2pgm -abbrev 255 sim/result.txt sim/result.pgm 3 | -------------------------------------------------------------------------------- /examples/working/primer/sobel/main.proj: -------------------------------------------------------------------------------- 1 | DOT_OPTS = -D ifile=pcb.pgm -D threshold=80 -suppress_cast_warnings 2 | SIM_OPTS = -D ifile=pcb.pgm -D threshold=80 -suppress_cast_warnings -abbrev_dc_ctors -warn_channels -dump_channel_stats 3 | SC_OPTS = -D ifile=pcb.pgm -D threshold=80 -suppress_cast_warnings -sc_abbrev_dc_ctors -sc_stop_time 160000 -sc_dump_fifo_stats 4 | VHDL_OPTS = -D ifile=pcb.pgm -D threshold=80 -suppress_cast_warnings -vhdl_annot_file fifo_stats.dat 5 | GHDL_RUN_OPTS = --stop-time=160000ns 6 | -------------------------------------------------------------------------------- /examples/working/primer/sobel/pcb.pgm: -------------------------------------------------------------------------------- 1 | ../../../imgs/pcb.pgm -------------------------------------------------------------------------------- /examples/working/primer/sobel2/main.procs: -------------------------------------------------------------------------------- 1 | PRE_PROC = pgm2txt -abbrev pcb.pgm pcb.txt 2 | POST_PROC = txt2pgm -abbrev 255 sim/result.txt sim/result.pgm 3 | -------------------------------------------------------------------------------- /examples/working/primer/sobel2/main.proj: -------------------------------------------------------------------------------- 1 | DOT_OPTS = -D ifile=pcb.pgm -D threshold=20 -suppress_cast_warnings -dot_show_indexes 2 | SIM_OPTS = -D ifile=pcb.pgm -D threshold=20 -suppress_cast_warnings -abbrev_dc_ctors -warn_channels -dump_channel_stats 3 | SC_OPTS = -D ifile=pcb.pgm -D threshold=20 -suppress_cast_warnings -sc_abbrev_dc_ctors -sc_stop_time 160000 -sc_dump_fifo_stats -sc_istream_hblank 4 -sc_istream_vblank 140 4 | VHDL_OPTS = -D ifile=pcb.pgm -D threshold=20 -suppress_cast_warnings -vhdl_annot_file ./systemc/fifo_stats.dat -vhdl_istream_blanking 5 | GHDL_RUN_OPTS = --stop-time=160000ns 6 | -------------------------------------------------------------------------------- /examples/working/primer/sobel2/main.rules: -------------------------------------------------------------------------------- 1 | pcb.bin: ../pcb.pgm 2 | $(PGM2BIN) -hblank 4 -vblank 140 12 $< $@ 3 | -------------------------------------------------------------------------------- /examples/working/primer/sobel2/pcb.pgm: -------------------------------------------------------------------------------- 1 | ../../../imgs/pcb.pgm -------------------------------------------------------------------------------- /examples/working/typing/generics1/main.cph: -------------------------------------------------------------------------------- 1 | -- This example illustrate the use of generic actors 2 | -- Here, the [id] actor is instanciated twice, with a different type for its IOs 3 | -- The [cmp] actor is generic wrt the size of its input 4 | -- 2013-04-25, JS 5 | 6 | actor id 7 | in (a:$t) 8 | out (c:$t) 9 | rules 10 | | a: x -> c: x 11 | ; 12 | 13 | actor cmp (v:unsigned) 14 | in (a:unsigned) 15 | out (c:bool) 16 | rules 17 | | a: x -> c: x>v 18 | ; 19 | 20 | stream i:unsigned<4> from "sample.txt"; 21 | stream o:bool to "result.txt"; 22 | 23 | net o = id (cmp 2 (id i)); 24 | -------------------------------------------------------------------------------- /examples/working/typing/generics1/main.proj: -------------------------------------------------------------------------------- 1 | SIM_OPTS = -abbrev_dc_ctors 2 | SC_OPTS = -sc_stop_time 100 -sc_abbrev_dc_ctors 3 | VHDL_OPTS = 4 | GHDL_RUN_OPTS = --stop-time=200ns 5 | -------------------------------------------------------------------------------- /examples/working/typing/generics1/sample.txt: -------------------------------------------------------------------------------- 1 | 1 2 3 4 2 | -------------------------------------------------------------------------------- /examples/working/typing/generics2/main.proj: -------------------------------------------------------------------------------- 1 | DOT_OPTS = 2 | SIM_OPTS = -abbrev_dc_ctors 3 | SC_OPTS = -sc_stop_time 200 -sc_abbrev_dc_ctors 4 | VHDL_OPTS = 5 | GHDL_RUN_OPTS = --stop-time=200ns 6 | -------------------------------------------------------------------------------- /examples/working/typing/generics2/sample1.txt: -------------------------------------------------------------------------------- 1 | < 1 2 3 4 > 2 | -------------------------------------------------------------------------------- /examples/working/typing/generics2/sample2.txt: -------------------------------------------------------------------------------- 1 | < 1 2 3 4 > 2 | -------------------------------------------------------------------------------- /examples/working/typing/gensz/main.cph: -------------------------------------------------------------------------------- 1 | -- This simple example illustrates the use of size-generic actors 2 | -- Lacking this feature would have obliged to declare _two_ [incr] actors with distinct signatures 3 | -- 2012-11-25, JS 4 | 5 | actor incr 6 | in (a:int) 7 | out (c:int) 8 | rules a -> c 9 | | v -> v+1 10 | ; 11 | 12 | stream i1:signed<8> from "sample1.txt"; 13 | stream o1:signed<8> to "result1.txt"; 14 | stream i2:unsigned<16> from "sample2.txt"; 15 | stream o2:unsigned<16> to "result2.txt"; 16 | 17 | net o1 = incr i1; 18 | net o2 = incr i2; 19 | 20 | -------------------------------------------------------------------------------- /examples/working/typing/gensz/main.proj: -------------------------------------------------------------------------------- 1 | SIM_OPTS = -abbrev_dc_ctors 2 | SC_OPTS = -sc_stop_time 100 -sc_abbrev_dc_ctors # 3 | VHDL_OPTS = 4 | GHDL_RUN_OPTS = --stop-time=200ns 5 | -------------------------------------------------------------------------------- /examples/working/typing/gensz/sample1.txt: -------------------------------------------------------------------------------- 1 | 1 2 3 4 2 | -------------------------------------------------------------------------------- /examples/working/typing/gensz/sample2.txt: -------------------------------------------------------------------------------- 1 | 1 2 3 4 2 | -------------------------------------------------------------------------------- /examples/working/typing/gfmux/main.cph: -------------------------------------------------------------------------------- 1 | -- This example illustrates generic functions and actors 2 | -- 2013-04-03, JS 3 | 4 | function fmux (c,x,y) = if c then x else y; -- : bool * $t * $t -> $t; 5 | 6 | actor mux () 7 | in (a:$t, b:$t, c:bool) 8 | out (d:$t) 9 | rules (a,b,c) -> d 10 | | (x,y,s) -> fmux(s,x,y) 11 | ; 12 | 13 | stream i11:signed<8> from "sample11.txt"; 14 | stream i12:signed<8> from "sample12.txt"; 15 | stream i3:bool from "sample3.txt"; 16 | stream o1:signed<8> to "result1.txt"; 17 | stream i21:unsigned<4> from "sample21.txt"; 18 | stream i22:unsigned<4> from "sample22.txt"; 19 | stream o2:unsigned<4> to "result2.txt"; 20 | 21 | -- definition section 22 | 23 | net o1 = mux (i11,i12,i3) ; -- Two instanciations of the [mux] actor (and hence [fmux] function) 24 | net o2 = mux (i21,i22,i3) ; -- with different types 25 | -------------------------------------------------------------------------------- /examples/working/typing/gfmux/main.proj: -------------------------------------------------------------------------------- 1 | SIM_OPTS = -abbrev_dc_ctors 2 | SC_OPTS = -sc_stop_time 800 -sc_abbrev_dc_ctors 3 | VHDL_OPTS = 4 | GHDL_RUN_OPTS = --stop-time=200ns 5 | -------------------------------------------------------------------------------- /examples/working/typing/gfmux/sample1.txt: -------------------------------------------------------------------------------- 1 | 1 3 5 7 9 2 | -------------------------------------------------------------------------------- /examples/working/typing/gfmux/sample11.txt: -------------------------------------------------------------------------------- 1 | 1 3 5 7 9 2 | -------------------------------------------------------------------------------- /examples/working/typing/gfmux/sample12.txt: -------------------------------------------------------------------------------- 1 | 2 4 6 8 10 2 | -------------------------------------------------------------------------------- /examples/working/typing/gfmux/sample2.txt: -------------------------------------------------------------------------------- 1 | 2 4 6 8 10 2 | -------------------------------------------------------------------------------- /examples/working/typing/gfmux/sample21.txt: -------------------------------------------------------------------------------- 1 | 1 3 5 7 9 2 | -------------------------------------------------------------------------------- /examples/working/typing/gfmux/sample22.txt: -------------------------------------------------------------------------------- 1 | 2 4 6 8 10 2 | -------------------------------------------------------------------------------- /examples/working/typing/gfmux/sample3.txt: -------------------------------------------------------------------------------- 1 | true false true false true 2 | -------------------------------------------------------------------------------- /examples/working/typing/mixedarithm1/main.proj: -------------------------------------------------------------------------------- 1 | SIM_OPTS = -suppress_cast_warnings # -phantom_types 2 | SC_OPTS = -sc_stop_time 800 -suppress_cast_warnings 3 | VHDL_OPTS = -suppress_cast_warnings -vhdl_io_converters 4 | GHDL_RUN_OPTS = --stop-time=400ns 5 | -------------------------------------------------------------------------------- /examples/working/typing/mixedarithm1/sample1.txt: -------------------------------------------------------------------------------- 1 | Signed 1 Signed 2 Signed 3 Signed -1 Signed -2 Signed -3 Unsigned 1 Unsigned 2 Unsigned 3 2 | -------------------------------------------------------------------------------- /examples/working/typing/mixedarithm1/sample2.txt: -------------------------------------------------------------------------------- 1 | Signed 1 Signed -1 Unsigned 2 Signed 1 Signed -1 Unsigned 2 Signed 1 Signed -1 Unsigned 2 2 | -------------------------------------------------------------------------------- /examples/working/typing/mixedarithm2/main.proj: -------------------------------------------------------------------------------- 1 | SIM_OPTS = -suppress_cast_warnings # -phantom_types 2 | SC_OPTS = -sc_stop_time 800 -suppress_cast_warnings # 3 | VHDL_OPTS = -suppress_cast_warnings -vhdl_io_converters 4 | GHDL_RUN_OPTS = --stop-time=400ns 5 | -------------------------------------------------------------------------------- /examples/working/typing/mixedarithm2/sample1.txt: -------------------------------------------------------------------------------- 1 | Signed 1 Signed 2 Signed 3 Signed -1 Signed -2 Signed -3 Unsigned 1 Unsigned 2 Unsigned 3 2 | -------------------------------------------------------------------------------- /examples/working/typing/mixedarithm2/sample11.txt: -------------------------------------------------------------------------------- 1 | Signed 1 Signed 2 Signed 3 Signed -1 Signed -2 Signed -3 Unsigned 1 Unsigned 2 Unsigned 3 2 | -------------------------------------------------------------------------------- /examples/working/typing/mixedarithm2/sample12.txt: -------------------------------------------------------------------------------- 1 | Signed 1 Signed -1 Unsigned 2 Signed 1 Signed -1 Unsigned 2 Signed 1 Signed -1 Unsigned 2 2 | -------------------------------------------------------------------------------- /examples/working/typing/mixedarithm2/sample2.txt: -------------------------------------------------------------------------------- 1 | Signed 1 Signed -1 Unsigned 2 Signed 1 Signed -1 Unsigned 2 Signed 1 Signed -1 Unsigned 2 2 | -------------------------------------------------------------------------------- /examples/working/typing/mixedarithm2/sample21.txt: -------------------------------------------------------------------------------- 1 | Signed 1 Signed 2 Signed 3 Signed -1 Signed -2 Signed -3 Unsigned 1 Unsigned 2 Unsigned 3 2 | -------------------------------------------------------------------------------- /examples/working/typing/mixedarithm2/sample22.txt: -------------------------------------------------------------------------------- 1 | Signed 1 Signed -1 Unsigned 2 Signed 1 Signed -1 Unsigned 2 Signed 1 Signed -1 Unsigned 2 2 | -------------------------------------------------------------------------------- /examples/working/typing/mixedarithm3/main.cph: -------------------------------------------------------------------------------- 1 | -- This is another generalization of the [mixedarithm1] example in which the sizes of the [signed/unsigned] 2 | -- values embedded in the [us] type constructor are specified as two distinct parameters of the type constructor, 3 | 4 | type us = 5 | Signed of signed 6 | | Unsigned of unsigned 7 | ; 8 | 9 | actor add 10 | in (a:us, b:us) 11 | out (c: us) 12 | rules 13 | | (a:Signed s1, b:Signed s2) -> c:Signed (s1+s2) 14 | | (a:Signed s, b:Unsigned u) -> c:Signed (s+(u:signed)) 15 | | (a:Unsigned u, b:Signed s) -> c:Signed ((u:signed)+s) 16 | | (a:Unsigned u1, b:Unsigned u2) -> c:Signed ((u1:signed)+(u2:signed)) 17 | ; 18 | 19 | stream i11:us<12,8> from "sample11.txt"; -- 12 bits for signed quantities, 8 for unsigned 20 | stream i12:us<12,8> from "sample12.txt"; 21 | stream o11:us<12,8> to "result11.txt"; 22 | 23 | net o11 = add (i11,i12); 24 | -------------------------------------------------------------------------------- /examples/working/typing/mixedarithm3/main.proj: -------------------------------------------------------------------------------- 1 | SIM_OPTS = -suppress_cast_warnings # -phantom_types 2 | SC_OPTS = -sc_stop_time 800 -suppress_cast_warnings # 3 | VHDL_OPTS = -suppress_cast_warnings -vhdl_io_converters 4 | GHDL_RUN_OPTS = --stop-time=400ns 5 | -------------------------------------------------------------------------------- /examples/working/typing/mixedarithm3/sample11.txt: -------------------------------------------------------------------------------- 1 | Signed 1 Signed 2 Signed 3 Signed -1 Signed -2 Signed -3 Unsigned 1 Unsigned 2 Unsigned 3 2 | -------------------------------------------------------------------------------- /examples/working/typing/mixedarithm3/sample12.txt: -------------------------------------------------------------------------------- 1 | Signed 1 Signed -1 Unsigned 2 Signed 1 Signed -1 Unsigned 2 Signed 1 Signed -1 Unsigned 2 2 | -------------------------------------------------------------------------------- /examples/working/typing/option/main.cph: -------------------------------------------------------------------------------- 1 | -- A simple example showing how to define and use variant types 2 | -- The [count] actors produces the running sum of optional values 3 | -- When the input token is [Some v] the value [v] is added to the current sum [s] 4 | -- When the input token is [None] the current sum [s] is unchanged 5 | -- In both cases, the current sum is output 6 | -- For example : 7 | -- if the token stream on input [a] is : Some 1, None, Some 5, None, None, Some 9 8 | -- then the token stream on output [c] will be : 1, 1, 6, 6, 6, 15 9 | 10 | type $t option = 11 | None 12 | | Some of $t 13 | ; 14 | 15 | actor count 16 | in (a:signed<8> option) 17 | out (c: signed<8>) 18 | var s: signed<8> = 0 19 | rules 20 | | a:None -> c:s 21 | | a:Some x -> (c:s+x, s:s+x) 22 | ; 23 | 24 | stream i1:signed<8> option from "sample1.txt"; 25 | stream o1:signed<8> to "result1.txt"; 26 | 27 | net o1 = count i1; 28 | -------------------------------------------------------------------------------- /examples/working/typing/option/main.proj: -------------------------------------------------------------------------------- 1 | SIM_OPTS = -abbrev_dc_ctors 2 | SC_OPTS = -sc_stop_time 800 -sc_abbrev_dc_ctors # 3 | VHDL_OPTS = -vhdl_io_converters 4 | GHDL_RUN_OPTS = --stop-time=200ns 5 | -------------------------------------------------------------------------------- /examples/working/typing/option/sample1.txt: -------------------------------------------------------------------------------- 1 | Some 1 None Some 5 None None Some 9 2 | -------------------------------------------------------------------------------- /examples/working/typing/ovfl/main.proj: -------------------------------------------------------------------------------- 1 | SIM_OPTS = -suppress_cast_warnings 2 | SIM_OPTS = -abbrev_dc_ctors -suppress_cast_warnings 3 | SC_OPTS = -sc_stop_time 100 -sc_abbrev_dc_ctors -suppress_cast_warnings 4 | VHDL_OPTS = -suppress_cast_warnings 5 | GHDL_RUN_OPTS = --stop-time=300ns 6 | -------------------------------------------------------------------------------- /examples/working/typing/ovfl/sample.txt: -------------------------------------------------------------------------------- 1 | 4 8 10 15 2 | -------------------------------------------------------------------------------- /examples/working/typing/resize/main.cph: -------------------------------------------------------------------------------- 1 | -- The typical example demonstrating the interest of dependent types. 2 | -- Here, the size of the result for the actor [resize] is specified using the its parameter [k]. 3 | -- 2015-05-28, JS 4 | 5 | actor resize (k:int) 6 | in (a:int) 7 | out (c:int) 8 | var z:signed -- not used, just put here to show that the type of a local variable can also depend on a parameter 9 | rules 10 | | a:x -> c:(x:int) 11 | ; 12 | 13 | stream i1:signed<8> from "sample1.txt"; 14 | stream o1:signed<4> to "result1.txt"; 15 | stream i2:unsigned<10> from "sample2.txt"; 16 | stream o2:unsigned<4> to "result2.txt"; 17 | 18 | net o1 = resize 4 i1; 19 | net o2 = resize 4 i2; 20 | 21 | -------------------------------------------------------------------------------- /examples/working/typing/resize/main.proj: -------------------------------------------------------------------------------- 1 | DOT_OPTS = 2 | SIM_OPTS = -abbrev_dc_ctors 3 | SC_OPTS = -sc_stop_time 200 -sc_abbrev_dc_ctors 4 | VHDL_OPTS = 5 | GHDL_RUN_OPTS = --stop-time=200ns 6 | -------------------------------------------------------------------------------- /examples/working/typing/resize/sample1.txt: -------------------------------------------------------------------------------- 1 | 1 3 7 15 31 2 | -------------------------------------------------------------------------------- /examples/working/typing/resize/sample2.txt: -------------------------------------------------------------------------------- 1 | 1 3 7 15 31 2 | -------------------------------------------------------------------------------- /examples/working/typing/tydecl1/main.proj: -------------------------------------------------------------------------------- 1 | SIM_OPTS = 2 | SC_OPTS = -sc_stop_time 800 3 | VHDL_OPTS = -vhdl_io_converters 4 | GHDL_RUN_OPTS = --stop-time=200ns 5 | -------------------------------------------------------------------------------- /examples/working/typing/tydecl1/sample1.txt: -------------------------------------------------------------------------------- 1 | UInt 1 Other true UInt 2 Other false 2 | -------------------------------------------------------------------------------- /examples/working/typing/tydecl1/sample2.txt: -------------------------------------------------------------------------------- 1 | UInt 1 Other 1 UInt 2 Other 0 2 | -------------------------------------------------------------------------------- /examples/working/typing/tydecl2/main.proj: -------------------------------------------------------------------------------- 1 | SIM_OPTS = 2 | SC_OPTS = -sc_stop_time 800 # 3 | VHDL_OPTS = -vhdl_io_converters 4 | GHDL_RUN_OPTS = --stop-time=200ns 5 | -------------------------------------------------------------------------------- /examples/working/typing/tydecl2/sample1.txt: -------------------------------------------------------------------------------- 1 | Single 1 Pair 2 true Single 3 Pair 4 false 2 | -------------------------------------------------------------------------------- /examples/working/typing/tydecl2/sample2.txt: -------------------------------------------------------------------------------- 1 | Single 1 Pair 2 10 Single 3 Pair 2 21 2 | -------------------------------------------------------------------------------- /gui/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | NSPrincipalClass 6 | NSApplication 7 | CFBundleIconFile 8 | 9 | CFBundlePackageType 10 | APPL 11 | CFBundleGetInfoString 12 | Created by Qt/QMake 13 | CFBundleSignature 14 | ???? 15 | CFBundleExecutable 16 | caphy 17 | CFBundleIdentifier 18 | com.yourcompany.caphy 19 | NOTE 20 | This file was generated by Qt/QMake. 21 | 22 | 23 | -------------------------------------------------------------------------------- /gui/Readme: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jserot/caph/2b3b241f0c32aa4fcaf60d4b8529956cca8aa6b1/gui/Readme -------------------------------------------------------------------------------- /gui/img/closefile.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jserot/caph/2b3b241f0c32aa4fcaf60d4b8529956cca8aa6b1/gui/img/closefile.png -------------------------------------------------------------------------------- /gui/img/closeproject.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jserot/caph/2b3b241f0c32aa4fcaf60d4b8529956cca8aa6b1/gui/img/closeproject.png -------------------------------------------------------------------------------- /gui/img/coller.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jserot/caph/2b3b241f0c32aa4fcaf60d4b8529956cca8aa6b1/gui/img/coller.png -------------------------------------------------------------------------------- /gui/img/color.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jserot/caph/2b3b241f0c32aa4fcaf60d4b8529956cca8aa6b1/gui/img/color.png -------------------------------------------------------------------------------- /gui/img/compile.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jserot/caph/2b3b241f0c32aa4fcaf60d4b8529956cca8aa6b1/gui/img/compile.png -------------------------------------------------------------------------------- /gui/img/compileSystemC.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jserot/caph/2b3b241f0c32aa4fcaf60d4b8529956cca8aa6b1/gui/img/compileSystemC.png -------------------------------------------------------------------------------- /gui/img/compileVHDL.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jserot/caph/2b3b241f0c32aa4fcaf60d4b8529956cca8aa6b1/gui/img/compileVHDL.png -------------------------------------------------------------------------------- /gui/img/compileXDF.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jserot/caph/2b3b241f0c32aa4fcaf60d4b8529956cca8aa6b1/gui/img/compileXDF.png -------------------------------------------------------------------------------- /gui/img/compilegraph.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jserot/caph/2b3b241f0c32aa4fcaf60d4b8529956cca8aa6b1/gui/img/compilegraph.png -------------------------------------------------------------------------------- /gui/img/copier.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jserot/caph/2b3b241f0c32aa4fcaf60d4b8529956cca8aa6b1/gui/img/copier.png -------------------------------------------------------------------------------- /gui/img/couper.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jserot/caph/2b3b241f0c32aa4fcaf60d4b8529956cca8aa6b1/gui/img/couper.png -------------------------------------------------------------------------------- /gui/img/exit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jserot/caph/2b3b241f0c32aa4fcaf60d4b8529956cca8aa6b1/gui/img/exit.png -------------------------------------------------------------------------------- /gui/img/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jserot/caph/2b3b241f0c32aa4fcaf60d4b8529956cca8aa6b1/gui/img/icon.png -------------------------------------------------------------------------------- /gui/img/new.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jserot/caph/2b3b241f0c32aa4fcaf60d4b8529956cca8aa6b1/gui/img/new.png -------------------------------------------------------------------------------- /gui/img/open.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jserot/caph/2b3b241f0c32aa4fcaf60d4b8529956cca8aa6b1/gui/img/open.png -------------------------------------------------------------------------------- /gui/img/preferences.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jserot/caph/2b3b241f0c32aa4fcaf60d4b8529956cca8aa6b1/gui/img/preferences.png -------------------------------------------------------------------------------- /gui/img/preferencescompil.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jserot/caph/2b3b241f0c32aa4fcaf60d4b8529956cca8aa6b1/gui/img/preferencescompil.png -------------------------------------------------------------------------------- /gui/img/save.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jserot/caph/2b3b241f0c32aa4fcaf60d4b8529956cca8aa6b1/gui/img/save.png -------------------------------------------------------------------------------- /gui/img/saveall.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jserot/caph/2b3b241f0c32aa4fcaf60d4b8529956cca8aa6b1/gui/img/saveall.png -------------------------------------------------------------------------------- /gui/img/select_all.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jserot/caph/2b3b241f0c32aa4fcaf60d4b8529956cca8aa6b1/gui/img/select_all.png -------------------------------------------------------------------------------- /gui/img/simu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jserot/caph/2b3b241f0c32aa4fcaf60d4b8529956cca8aa6b1/gui/img/simu.png -------------------------------------------------------------------------------- /gui/optdesc/options_spec.txt: -------------------------------------------------------------------------------- 1 | ../../compiler/options_spec.txt -------------------------------------------------------------------------------- /lib/Makefile: -------------------------------------------------------------------------------- 1 | SUBDIRS=c etc systemc vhdl caph 2 | 3 | install: 4 | (cd c; $(MAKE) install) 5 | (cd systemc; $(MAKE) install) 6 | (cd vhdl; $(MAKE) install) 7 | (cd caph; $(MAKE) install) 8 | (cd etc; $(MAKE) install) 9 | 10 | clean: 11 | @for i in $(SUBDIRS); do (cd $$i; make -s clean); done 12 | 13 | clobber: 14 | @for i in $(SUBDIRS); do (cd $$i; make -s clobber); done 15 | 16 | realclean: clobber 17 | -------------------------------------------------------------------------------- /lib/c/Makefile: -------------------------------------------------------------------------------- 1 | include ../../config 2 | 3 | CCFLAGS = -Wno-format -Wno-parentheses -Wno-unsequenced # gcc 4 compatibility 4 | LDFLAGS = 5 | SOURCES = tyconv.c 6 | OBJS = $(SOURCES:.c=.o) 7 | TARGETLIB = libtyconv.a 8 | 9 | all: libtyconv.a 10 | 11 | libtyconv.a: $(OBJS) 12 | $(AR) -q $(TARGETLIB) $(OBJS) 13 | 14 | .c.o: 15 | $(CC) $(CCFLAGS) -c -g -o $@ $< 16 | 17 | install: libtyconv.a 18 | $(INSTALL) -d $(CAPH_C_LIB) 19 | $(INSTALL) $(TARGETLIB) $(CAPH_C_LIB) 20 | $(INSTALL) tyconv.h $(CAPH_C_LIB) 21 | 22 | clean: 23 | -rm -f *.o *~ *_old $(EXE) $(TARGETLIB) 24 | -rm -f a.out 25 | -rm -f core 26 | 27 | clobber: realclean 28 | 29 | realclean: clean 30 | -rm -f libtyconv.a 31 | 32 | tyconv.o: tyconv.c 33 | -------------------------------------------------------------------------------- /lib/c/README: -------------------------------------------------------------------------------- 1 | The files of this directory form the C support library for the CAPH distribution. 2 | This library is used by several programs in the [tools] directory on the distribution and 3 | also by the C programs generated by the compiler for reading/writing values having user-defined datatypes. 4 | -------------------------------------------------------------------------------- /lib/caph/Makefile: -------------------------------------------------------------------------------- 1 | include ../../config 2 | 3 | install: 4 | $(INSTALL) -d $(CAPH_CAPH_LIB) 5 | (for f in *.cph; do $(INSTALL) $$f $(CAPH_CAPH_LIB); done) 6 | 7 | clean: 8 | -rm -f *~ 9 | 10 | realclean: clean 11 | clobber: realclean 12 | -------------------------------------------------------------------------------- /lib/caph/README: -------------------------------------------------------------------------------- 1 | This directory contains the "standard libraries" for the CAPH distribution. 2 | The individual files should be included with "#include" directive in your source code and the 3 | CAPH compiler should be invoked with the "-I " option, where is the actual location of the libraries. 4 | Updated for v2.7.2, 2016-03-01, JS. 5 | -------------------------------------------------------------------------------- /lib/caph/imgops.cph: -------------------------------------------------------------------------------- 1 | img_ops.cph -------------------------------------------------------------------------------- /lib/caph/listops.cph: -------------------------------------------------------------------------------- 1 | list_ops.cph -------------------------------------------------------------------------------- /lib/caph/streamops.cph: -------------------------------------------------------------------------------- 1 | stream_ops.cph -------------------------------------------------------------------------------- /lib/etc/Makefile: -------------------------------------------------------------------------------- 1 | include ../../config 2 | 3 | install: 4 | $(INSTALL) -d $(CAPH_ETC_LIB) 5 | $(CP) Makefile.core $(CAPH_ETC_LIB) 6 | $(CP) ../../config $(CAPH_ETC_LIB) 7 | 8 | clean: 9 | -rm -f *~ 10 | 11 | realclean: clean 12 | clobber: realclean 13 | -------------------------------------------------------------------------------- /lib/systemc/Makefile: -------------------------------------------------------------------------------- 1 | include ../../config 2 | 3 | CXXFLAGS = -I. -I$(SYSTEMC)/include -Wno-deprecated -DTRACE_SYSC_IO 4 | LDFLAGS = -L$(SYSTEMC)/lib-$(TARGET_ARCH) 5 | SOURCES = # no source : pure template lib 6 | OBJS = $(SOURCES:.cpp=.o) 7 | 8 | all: 9 | @echo "Nothing to do" 10 | 11 | install: 12 | $(INSTALL) -d $(CAPH_SYSC_LIB) 13 | (for f in *.h; do $(CP) $$f $(CAPH_SYSC_LIB); done) 14 | $(CP) README $(CAPH_SYSC_LIB) 15 | 16 | clean: 17 | -rm -f *~ 18 | # (cd tests; make clean) 19 | 20 | realclean: clean 21 | 22 | clobber: realclean 23 | -------------------------------------------------------------------------------- /lib/systemc/README: -------------------------------------------------------------------------------- 1 | The files of this directory form the SystemC support library for the CAPH distribution. 2 | This library should be accessible to your SystemC compiler in order to compile/execute 3 | the code generated by the SystemC backend of the CAPH compiler 4 | -------------------------------------------------------------------------------- /lib/vhdl/README: -------------------------------------------------------------------------------- 1 | The files of this directory form the VHDL support library for the CAPH distribution. 2 | When built, this library should be accessible to your VHDL compiler in order to simulate/synthetize 3 | the code generated by the VHDL backend of the CAPH compiler 4 | -------------------------------------------------------------------------------- /man/Makefile.dist: -------------------------------------------------------------------------------- 1 | include ../config 2 | 3 | all: 4 | @echo "Nothing to do" 5 | 6 | install: 7 | $(INSTALL) -d $(MANDIR) 8 | (for f in *.$(MANEXT); do $(CP) $$f $(MANDIR); done) 9 | 10 | clean: 11 | @echo "Nothing to clean" 12 | 13 | realclean: 14 | rm -f *.$(MANEXT) *.tex 15 | 16 | clobber: realclean 17 | -------------------------------------------------------------------------------- /tools/README: -------------------------------------------------------------------------------- 1 | This directory contains utilities for 2 | - converting text and pgm files from (resp. to) the specific binary format which is used 3 | by the VHDL testbench to read (resp. write) input (resp. output) data. 4 | - generating .cph source files from higher level specifications 5 | - generating top-level Makefile from project descriptions (caphmake) 6 | -------------------------------------------------------------------------------- /tools/_tags: -------------------------------------------------------------------------------- 1 | true: annot, explain 2 | : syntax(camlp4o), package(camlp4.listcomprehension) 3 | : use_unix 4 | : use_unix 5 | : use_dynlink, use_str, use_unix 6 | -------------------------------------------------------------------------------- /tools/compiler: -------------------------------------------------------------------------------- 1 | ../compiler --------------------------------------------------------------------------------