The
(vl-server cmdargs &optional (state 'state)) → state
Function:
(defun vl-server-fn (cmdargs state) (declare (xargs :stobjs (state))) (declare (xargs :guard (string-listp cmdargs))) (let ((__function__ 'vl-server)) (declare (ignorable __function__)) (b* (((mv errmsg opts extra-args) (parse-vl-server-opts cmdargs)) ((when errmsg) (die "~@0~%" errmsg) state) ((when extra-args) (die "Unrecognized arguments: ~x0" extra-args) state) ((vl-server-opts opts) opts) ((when opts.help) (vl-cw-ps-seq (vl-print *vl-server-help*)) (exit-ok) state) ((when opts.readme) (vl-cw-ps-seq (vl-print *vl-server-readme*)) (exit-ok) state) (max-mem (* (expt 2 30) opts.mem)) (1/3-mem (floor max-mem 3)) (- (acl2::set-max-mem max-mem)) (- (set-vl-gc-baseline)) (- (set-vl-gc-threshold 1/3-mem)) (- (set-vls-root opts.root)) ((unless (<= opts.port 65535)) (die "Invalid port ~x0~%" opts.port) state) ((mv & hostname state) (getenv$ "HOSTNAME" state)) (- (cw "Starting VL server on ~s0:~x1~%" hostname opts.port)) (- (start :port opts.port :public-dir opts.public))) (cw "Starting VL Shell for the server.~%") (vl-shell nil))))