writer_mecpu.tcl
Go to the documentation of this file.00001 
00002 
00003 
00004 
00005 
00006 
00007 
00008 
00009 
00010 
00011 
00012 
00013 
00014 
00015 
00016 
00017 
00018 
00019 
00020 
00021 
00022 
00023 
00024 
00025 
00026 
00027 
00028 
00029 
00030 
00031 
00032 
00033 
00034 
00035 
00036 
00037 
00038 
00039 package require page::gen::peg::mecpu
00040 
00041 global usec
00042 global timed
00043     timed =  0
00044 
00045 
00046 
00047 
00048 ret  page_wlabel () {
00049     return {ME cpu Assembler}
00050 }
00051 
00052 ret  page_wfeature (type key) {
00053     return [string eq $key timeable]
00054 }
00055 
00056 ret  page_wtime () {
00057     global timed
00058     set    timed 1
00059     return
00060 }
00061 
00062 ret  page_wgettime () {
00063     global  usec
00064     return $usec
00065 }
00066 
00067 ret  page_whelp () {
00068     return {}
00069 }
00070 
00071 ret  page_woptions () {
00072     return {--package --copyright --template --cmarker}
00073 }
00074 
00075 ret  page_wconfigure (type option , type value) {
00076     switch -exact -- $option {
00077     --package {
00078         page::gen::peg::mecpu::package $value
00079     }
00080     --copyright {
00081         page::gen::peg::mecpu::copyright $value
00082     }
00083     --template {
00084         page::gen::peg::mecpu::template $value
00085     }
00086     --cmarker {
00087         page::gen::peg::mecpu::cmarker $value
00088     }
00089     default {
00090         return -code error "Cannot set value of unknown option \"$option\""
00091     }
00092     }
00093 }
00094 
00095 ret  page_wrun (type chan , type data) {
00096     global timed usec
00097     page_log_info "writer/me-cpu/run/"
00098 
00099     if {$timed} {
00100     set usec [lindex [time {
00101         page::gen::peg::mecpu $data $chan
00102     }] 0] ; #{}
00103     } else {
00104     page::gen::peg::mecpu $data $chan
00105     }
00106     page_log_info "writer/me-cpu/run/ok"
00107     return
00108 }
00109 
00110 
00111 
00112 
00113 
00114 
00115 
00116 package provide page::writer::mecpu 0.1.1
00117